home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume26 / ee-1.23 / part01 next >
Encoding:
Text File  |  1993-06-19  |  90.0 KB  |  2,423 lines

  1. Newsgroups: comp.sources.unix
  2. From: lbroda@s.psych.uiuc.edu (Larry Broda)
  3. Subject: v26i242: ee-1.23 - simple text editor for novice users, Part01/01
  4. Sender: unix-sources-moderator@gw.home.vix.com
  5. Approved: vixie@gw.home.vix.com
  6.  
  7. Submitted-By: lbroda@s.psych.uiuc.edu (Larry Broda)
  8. Posting-Number: Volume 26, Issue 242
  9. Archive-Name: ee-1.23/part01
  10.  
  11. #! /bin/sh
  12. # This is a shell archive.  Remove anything before this line, then unpack
  13. # it by saving it into a file and typing "sh file".  To overwrite existing
  14. # files, type "sh file -c".  You can also feed this as standard input via
  15. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  16. # will see the following message at the end:
  17. #        "End of archive 1 (of 1)."
  18. # Contents:  HELP-MANUAL HELP-WINDOW HELP-WINDOW-ADVANCED MANIFEST
  19. #   Makefile.templ README easy-edit.man easyedit.el ee.license
  20. #   ee.sh.template
  21. # Wrapped by vixie@gw.home.vix.com on Sun Jun 20 12:03:47 1993
  22. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  23. if test -f 'HELP-MANUAL' -a "${1}" != "-c" ; then 
  24.   echo shar: Will not clobber existing file \"'HELP-MANUAL'\"
  25. else
  26. echo shar: Extracting \"'HELP-MANUAL'\" \(19631 characters\)
  27. sed "s/^X//" >'HELP-MANUAL' <<'END_OF_FILE'
  28. XEasy-edit v1.22    by Larry Broda  Dept. of Psychology, Univ. of Illinois
  29. X
  30. XScrolling this window                               
  31. X=====================
  32. X    The HELP window may be scrolled using the following commands:
  33. X    ESC f -  forward one page
  34. X    ESC F -  forward one line
  35. X    ESC > -  forward to next topic (in this Manual only)
  36. X    ESC b -  backward one page
  37. X    ESC B -  backward one line
  38. X    ESC < -  backward to previous topic (in this Manual only)
  39. X
  40. XIntroduction                        (ESC > next topic    ESC < previous topic)
  41. X============     
  42. X
  43. X    Easy-edit (or "ee") is  a simple text  editor  designed to  be 
  44. Xto be usable without any previous instruction.   Easy-edit splits your
  45. Xscreen into  two "windows",  one in which you edit   your file and the
  46. Xother in which a list of editing commands is displayed.
  47. X    Type  in  text as with a word processor; line wraps will occur
  48. Xautomatically if  you  do not type carriage returns.  Editing commands
  49. Xare of two types:
  50. X
  51. X    1. Control commands (notated "^<key>"; e.g. ^A): Press the
  52. X       control key and the letter key together.
  53. X
  54. X    2. Escape commands (notated "ESC <key>"; e.g. ESC A): Press
  55. X           and release "escape" key, then press the other key.
  56. X
  57. X    In most  cases the case of the letter following "ESC" does not
  58. Xmatter  (that  is, an "ESC S" is  the same as "ESC  s");  but in a few
  59. Xcases  (such as HELP window scrolling)  there is  a difference between
  60. Xthe upper and lower case version.
  61. X
  62. XExiting/Saving work                (ESC > next topic    ESC < previous topic)
  63. X===================
  64. XESC S   -  Save and Exit
  65. X
  66. X    To exit easy-edit and save your work, press ESC, the S.  This
  67. Xwill write your changes to the file and exit the editor.
  68. X
  69. XESC W   -  Save without exiting
  70. X
  71. X    ESC W save your changes as in ESC S, but does not exit the editor.
  72. XThis is useful for periodically saving your changes if you are worried
  73. Xabout a system crash or phone-line disconnection. 
  74. X
  75. XESC Q   -  Abort
  76. X    To  quit  from  easy-edit without  saving the changes you have
  77. Xmade,  type ESC,  then Q.   You will be asked  if  you  really want to
  78. Xcancel your changes;  answer "yes" to proceed with  the abort, or "no"
  79. Xto continue editing.  If you are creating a new file and abort with an
  80. XESC Q, the file will not be created.
  81. X
  82. XESC T  -  Save to a different file and Exit
  83. X
  84. X    ESC T allows you to save your editing to a different file from
  85. Xthe one you originally began editing.  The  original file will be left
  86. Xunchanged.   You will  be asked for the new  filename and if it  is an
  87. Xexisting file, you will be warned and asked whether you really want to
  88. Xreplace the  current file.  ESC T will  fail if you try  to write to a
  89. Xfile  that you  do  not have read  access to  or create   a  file in a
  90. Xdirectory that you do not have write access to.
  91. X
  92. X
  93. XMoving the cursor                   (ESC > next topic    ESC < previous topic)
  94. X================
  95. X^P / up arrow 
  96. X^N / down arrow
  97. X^F / right arrow
  98. X^B / left arrow
  99. X
  100. X    When  you type  text,  it  will  be  inserted  at  the cursor
  101. Xposition; likewise,  the  effect of editing commands is determined by
  102. Xthe cursor position.
  103. X    On most  terminals or PCs, the arrow keys may be  used to move
  104. Xthe cursor  around  within  the file one character  or line at a time.
  105. XAlternatively, the control keys listed above may be used.  To move the
  106. Xcursor  by more than  one character or line  at  a time, the following
  107. Xcommands may be used:
  108. X
  109. X   ^G - move forward (right) one word    
  110. X   ^B - move backwards (left) one word
  111. X   ^D - move forward one screenfull       
  112. X   ^U - move backwards one screenfull
  113. X   ^A - move to the beginning of the line
  114. X   ^E - move to the end of the line
  115. XESC A - move to the beginning of the file.
  116. XESC E - move to the end of the file
  117. XESC G - move to a particular line number (it will ask you for the
  118. X        number).
  119. X
  120. XOverwrite/Insert                   (ESC > next topic    ESC < previous topic)
  121. X===============
  122. XESC N   -   Overwrite/Insert mode toggle
  123. X
  124. X    When you  initially  enter easy-edit, you  are in insert mode,
  125. Xand text you type in is inserted into the file at the cursor location.
  126. XThe text to  the right of  the cursor is pushed over  to make room for
  127. Xthe new text.  The ESC N command switches  you into overwrite mode, so
  128. Xthat text you  type in is written *over*  the current text,  replacing
  129. Xit.  ESC N is a toggle switch; whichever typing mode you are in, ESC N
  130. Xwill switch to the other mode.
  131. X
  132. XUndo                              (ESC > next topic    ESC < previous topic)
  133. X====
  134. XESC U  -  Undo
  135. X
  136. X    The ESC U (undo)  command lets you correct editing mistakes or 
  137. Xby reversing the editing action.  The ESC U can command  repeatedly to
  138. Xundo  earlier   changes;  each time  the  preceding  command  will  be
  139. X"undone".  There is a limit  to the number  of  commands  that can  be
  140. Xreversed; this is dependent upon  the types of  commands they were, as
  141. Xit takes varying amounts of  space to  store different commands in the
  142. Xeditor's memory.
  143. X
  144. X
  145. XHELP Window                       (ESC > next topic    ESC < previous topic)
  146. X===========
  147. XESC F   -   Scroll HELP window forward one screenfull
  148. XESC f   -   Scroll HELP window forward one line
  149. XESC B   -   Scroll HELP window backward one screenfull
  150. XESC b   -   Scroll HELP window backward one line
  151. X
  152. X    The HELP Window lists the editing commands that  are available
  153. Xto you.  Since there are more commands than can be  listed  at once in
  154. Xthe window, the ESC F  and  ESC B commands  may be used to  scroll the
  155. XHELP window  forward and backward, respectively.   Note that these are
  156. Xamong the only commands in which the case of the letter matters.
  157. X
  158. XESC V   -   Switch between regular HELP/ short HELP
  159. X
  160. X    When  you  are more familiar  with easy-edit,  you may want to
  161. Xswitch the more  concise "advanced" HELP  window,  which in some cases
  162. Xwill  fit entirely  on one page.   You may switch between the standard
  163. XHELP window and  the advanced version  with the ESC  V command.  Also,
  164. Xyou may display the advanced HELP window on initial entry by following
  165. Xthe "ee" command with the "-e" option; e.g. ee -e filename.
  166. X
  167. XESC Z   -   Remove HELP window
  168. XESC H   -   Restore HELP window
  169. XESC J   -   Shrink HELP window (Enlarge EDIT window)
  170. X
  171. X    If you  feel you do not need the HELP listing at all and would
  172. Xlike to have the entire screen space available for displaying the file
  173. Xyou are editing, use the ESC Z command to "zap" the HELP window.   The
  174. Xcommand ESC H will bring the HELP window back.  If  you merely want to
  175. Xshrink the size of the HELP window  to gain  additional  space for the
  176. Xediting window, use the ESC J command.  Each time you  type ESC J, the
  177. Xedit window will grow be one line, at the expense of  the HELP window.
  178. XESC H may be used at any time to return the windows  to their original
  179. Xsizes.
  180. X    You may also start ee with the HELP window turned off by giving
  181. Xit a -z option (e.g. ee -z filename).
  182. X
  183. XDeleting text                       (ESC > next topic    ESC < previous topic)
  184. X=============
  185. XBackspace / ^H   -  backspace over text
  186. X
  187. X    A backspace  will move  the cursor backwards one character and
  188. Xdelete that character in the  usual fashion.   On some terminals (esp.
  189. XPCs), the backspace key may be redefined to be something else.  If the
  190. Xbackspace key does not work, you may use ^H instead;  the DEL key will
  191. Xalso work as a backspace on many keyboards.
  192. X
  193. X^X - delete character
  194. X^W - delete word
  195. X
  196. X    A character  may be deleted  by moving  the cursor over it and
  197. Xtyping ^X.  An entire word may be deleted by placing the cursor at the
  198. Xbeginning of the  word and  typing ^W.   If the cursor  is  not at the
  199. Xbeginning of the word, only  the  portion of the  word from the cursor
  200. Xposition to the end will be erased.
  201. X
  202. XESC L  -  delete line
  203. X
  204. X    ESC L deletes the line that the cursor is on; the lines above
  205. Xand below this line move together to fill in the space.
  206. X
  207. XESC X  -  delete to end of line
  208. X
  209. X    ESC X  erases the  line that the  cursor is on from the cursor
  210. Xposition to the end of the line.  If the cursor is at the beginning of
  211. Xthe line, a blank line will remain.  If the line  is already blank, it
  212. Xwill be deleted as with an ESC L.
  213. X
  214. XESC K -  delete to end of file
  215. X
  216. X    ESC K deletes everything from the cursor position to the end
  217. Xof the file.  (Reminder: An ESC U (undo) will restore the text.)
  218. X
  219. X
  220. XUndeleting                       (ESC > next topic    ESC < previous topic)
  221. X=========
  222. X
  223. X^Y  -  Undelete line/word
  224. X
  225. X    ^Y Undeletes a line or word erased by ^W, ESC L, or ESC X.  If
  226. Xdone   immediately  after  the  delete, the   text is restored  in its
  227. Xoriginal location.  However, if the cursor has moved, the text will be
  228. Xrestored at the new cursor location.  In addition,  repeating  ^Y will
  229. Xinsert extra copies of the deleted text into the file; in  this way ^Y
  230. Xcan be used to copy or move segments of text in the file.
  231. X    If multiple ESC L, ESC X, or ^W commands were done in sequence
  232. X(with no cursor motion or other commands between), the ^Y will restore
  233. Xeverything that was deleted.
  234. X    Note  that for situations where ^Y does not restore deleted or
  235. Xchanged text  (for example, text deleted with  ^Xs),  the Undo (ESC U)
  236. Xcommand can restore the file  to its  previous state.  Note  also that
  237. Xunlike ^Y,  ESC U  will restore deleted  text to its original location
  238. Xonly  (it will  also  remove newly inserted   text;   Undo undoes  all
  239. Xchanges).
  240. X
  241. X
  242. XMoving Blocks of Text           (ESC > next topic    ESC < previous topic)
  243. X=====================
  244. X
  245. XESC /  -  Mark block
  246. XESC +  -  Insert block
  247. X
  248. X    Although text can be moved by deleting and undeleting (or retyping
  249. Xit), often it is more convenient to be able to mark a block of text and 
  250. Xmove or copy it.  To move a block of text means to delete the block and 
  251. Xre-insert it somewhere else in the file.  To copy the block means that the
  252. Xoriginal block is left intact, but a copy of it is also inserted somewhere 
  253. Xelse.
  254. X    To move or copy a block, position the cursor the beginning of the 
  255. Xblock of text (it may be the middle of a line) and type ESC /.  Then move
  256. Xthe cursor to the other end of the block and type ESC / again.  This will 
  257. Xmark the block.  At this point you will be asked whether you want to move
  258. Xor copy the block (see paragraph above).  If you choose "m" for move, the
  259. Xoriginal block will be deleted; if you choose "c", it will be left intact.
  260. XIn either case, you may now insert the block where the cursor is located by
  261. Xtyping ESC +.  This may be done repeatedly; ee will remember the block 
  262. Xthroughout the editing session until the next block is marked.
  263. X
  264. X
  265. XSearching                       (ESC > next topic    ESC < previous topic)
  266. X========
  267. X
  268. X^S    -   Search forward
  269. X^Q    -   Search backward
  270. X
  271. X    ^S searches for a  text string  (you will  be prompted for it)
  272. Xfrom the cursor location to the end of the file.  ^Q searches from the
  273. Xcursor location  backwards to the beginning  of the file.  If the text
  274. Xis  found, the  cursor  is positioned   to  that location.  The search
  275. Xignores case.  If you merely  hit return when  prompted for the search
  276. Xstring, the previous search string will be used (if there was one).
  277. X
  278. X
  279. XSubstituting                       (ESC > next topic    ESC < previous topic)
  280. X===========
  281. X
  282. XESC Y   -   Search/Replace
  283. X
  284. X    ESC Y searches for and replaces every instance of a given string 
  285. Xwith a new string.  The replacement is done from the current position to
  286. Xthe end of the file.  You will be asked for both strings, and then for
  287. Xconfirm or no confirm.  Without confirm, all replacements are done without
  288. Xpause.  If you say "y" for confirm, the cursor will stop at each instance of
  289. Xthe search string and ask you to confirm before replacing it.  At this
  290. Xpoint, the following options are available:
  291. X
  292. X  y     - do the replacement and continue searching
  293. X  n     - don't replace, but continue searching
  294. X  .     - Replace this occurrence and stop
  295. X  q     - Don't replace, and stop
  296. X  !     - replace all occurrences from here on without confirming
  297. X
  298. X    ESC or "n" will stop the search/replace at any time.  To replace only
  299. Xone (or fewer than every) instance of the search string, use confirm, and
  300. Xuse the "n" option to skip those you don't want to replace.  Then use "." 
  301. Xto replace and stop when you reach the one you want to change.
  302. X
  303. X
  304. XReformatting                       (ESC > next topic    ESC < previous topic)
  305. X============
  306. XESC P   -   fill paragraph
  307. X
  308. X    Typing ESC P reformats the paragraph in which the cursor rests,
  309. X splitting lines which are too  long and  splicing short ones  together
  310. Xuntil all the lines fill the width  of  the  page as well as possible.
  311. XThe command is useful if editing changes have caused  you to have very
  312. Xshort or long lines.  The program considers  a paragraph to be a block
  313. Xof lines separated by blank lines from the  surrounding  text; it does
  314. X*not* recognize indented lines as starting paragraphs.
  315. X    A  repeat count  has a special meaning if used with ESC P.  If
  316. Xyou use an ESC C to give ESC P a repeat count (the actual value of the
  317. Xcount will be ignored), it will justify the paragraph on both the left
  318. Xand right margins.
  319. X
  320. X
  321. XRepeat                       (ESC > next topic    ESC < previous topic)
  322. X=====
  323. XESC C    -  repeat command
  324. XESC <number> 
  325. X    ESC C  allows you  to   give a  "repeat"  argument  to   the 
  326. Xfollowing command.  Some commands will  ignore the  argument; however,
  327. Xmotion and deletion commands will honor it.  To  use the command, type
  328. XESC C  #  <command>, where # is the  repeat count and  <command>  is a
  329. Xvalid editing command.  ESC C has a special meaning for ESC P; see the
  330. Xdocumentation on ESC P for details.
  331. X    ESC  followed   by  a number  has  the same   meaning as ESC C. 
  332. Xif the  ESC C  <number> or ESC  <number> is   followed by  a   regular
  333. Xcharacter, that character will be repeated as if you had typed in that
  334. Xmany times.
  335. X
  336. XExamples:
  337. X    ESC C 12 ESC L       will delete 12 lines (a ^Y following this
  338. X                             will insert all 12 lines back into the file)
  339. X    ESC 18 ^X            will delete the next 18 characters
  340. X     ESC C 5  ^N          will move the cursor down 5 lines
  341. X    ESC 25 j             will insert 25 "j"s into the file
  342. X
  343. X    
  344. XInserting Files                     (ESC > next topic    ESC < previous topic)
  345. X==============
  346. XESC I    -   Insert a file 
  347. X
  348. X    This  command allows you  to  insert  the   contents  of 
  349. Xanother file into the file you are editing.  You will be asked for the
  350. Xname of the file to insert.  If the file is  found, its  contents will
  351. Xbe inserted at the cursor position.
  352. X
  353. XESC D    -   List a directory
  354. X
  355. X    This command is useful when you can't remember the name of the
  356. Xfile you want to insert.  It will  give you a  directory listing  in a
  357. Xtemporary window which  replaces the HELP  window.  You will be  asked
  358. Xfor the name of the directory to list, or you  may hit  return to list
  359. Xyour  current  working   directory.   While  the directory   window is
  360. Xdisplayed, you are prompted for an f, b, or r command.  f and b scroll
  361. Xthe listing forward and backward, respectively (if it is longer than a
  362. Xwindowfull), and the   r  command  restores removes the    listing and
  363. Xreturns you to editing.
  364. X
  365. X
  366. XUnix Commands                       (ESC > next topic    ESC < previous topic)
  367. X============
  368. XESC !    -    Execute a Unix command in window
  369. X
  370. X    The ESC ! (exclamation point) command allows you to execute a
  371. XUnix command and display it in a window which temporarily replaces the
  372. XHELP window.  The   command  *must*   be  of the type   which    lists
  373. Xinformation but does not require further input from  you; for example,
  374. X"who", "ls", "cat filename", or "date", are allowable; "Elm", "nn", or
  375. X"talk" are not, since you would be  required to type further input for
  376. Xthese commands. (See ^Z below for interactive unix commands).
  377. X    The results of the command are listed in a window identical to
  378. Xthe  ESC D  window,   with the same    options  for scrolling  and one
  379. Xadditional  choice:  an "i" command which  will insert the contents of
  380. Xthe window  (i.e.  the command  output) into your   file at the cursor
  381. Xlocation.  For  example,  you  could use ESC  ! to  execute the "date"
  382. Xcommand, and then insert the date into your file with an "i".
  383. X
  384. X
  385. XRefresh screen                       (ESC > next topic    ESC < previous topic)
  386. X==============
  387. X^R     -     Redraw the screen
  388. X
  389. X    If extraneous messages such as notification of incoming mail
  390. Xor  requests  to "talk" jumble   your editing display, type  a   ^R to
  391. Xrestore the screen.
  392. X
  393. X
  394. XRecovery                       (ESC > next topic    ESC < previous topic)
  395. X========
  396. XESC R   -    Recover file from aborted edit session
  397. X
  398. X    If you are editing a file and the editor is aborted (either
  399. Xintentionally  with ESC   Q, or accidently due to   a system  crash or
  400. Xdisconnection),  your  editing session is  not  necessarily lost.  The
  401. Xnext time you edit this file with easy-edit, you  will probably  get a
  402. Xmessage warning you  that a recovery file  exists and  suggesting that
  403. Xyou do  ESC R to recover. 
  404. X     As you  edit, easy-edit periodically   saves your file  to  a
  405. Xrecovery file, and each time you edit  a file the editor  first checks
  406. Xfor a recovery file which is newer than the file itself.  If  you have
  407. Xreceived the  warning message and want to  recover  your lost changes,
  408. Xtype ESC R.  The  editor will ask you if  you really want to  recover,
  409. Xand if you answer "yes", the editor will read in  the recovery file in
  410. Xplace of  the  old version.  (Note  that the actual  file will  not be
  411. Xchanged until you exit with an  ESC S).  If,  upon seeing the recovery
  412. Xfile, you decide that you would rather keep the old version, simply do
  413. Xan ESC U (undo) to undo the recovery, or abort the editor  with an ESC
  414. XQ.  However,   you will continue   to receive  the warning about   the
  415. Xrecovery file upon editing that file until you  modify the file and do
  416. Xa save (ESC S) so  that the true  file becomes newer than the recovery
  417. Xfile.
  418. X
  419. XSuspending the Editor               (ESC > next topic    ESC < previous topic)
  420. X====================
  421. X^Z  -   Suspend (temporarily) editor
  422. X
  423. X    A ^Z will temporarily suspend easy-edit and return you to a
  424. XUnix prompt, where you may read  mail, or even  edit a different file.
  425. XWhen you wish to  resume the editing session  you suspended, type "fg"
  426. X(for  "foreground").  If you do  not  resume the suspended session and
  427. Xattempt to logout, you will find that the system will not  log you off
  428. Xand will warn you that you have "stopped jobs".
  429. X
  430. X
  431. XStatus
  432. X======
  433. X^T  -   Edit status
  434. X
  435. X    Type ^T to review the time, the name of the file you are editing,
  436. Xand whether or not you have modified the file during this edit.
  437. X
  438. XEasyedit license
  439. X================
  440. XESC @  -  License Info
  441. X    
  442. X    ESC @ displays licensing informatin in a special window similar to
  443. Xthe directory window.  The information displayed is the same as follows:
  444. X
  445. XEasy-edit novice screen editor for Unix systems with GNU emacs
  446. X
  447. X
  448. X     Easy-edit 1.22
  449. X
  450. X     Copyright (C) 1992     Larry Broda
  451. X                            Department of Psychology
  452. X                            University of Illinois at Urbana-Champaign
  453. X
  454. X    This program is distributed in the hope that it will be useful, 
  455. X    but WITHOUT ANY WARRANTY; without even the implied warranty of 
  456. X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  This program  
  457. X    is an extension of GNU emacs; See the GNU General Public License  
  458. X    for more details. 
  459. X
  460. X    This program is free software; you can redistribute it and/or modify
  461. X    it under the same terms as the GNU General Public License as published by
  462. X    the Free Software Foundation either version 1, or (at your option)
  463. X    any later version.
  464. X
  465. X       By Larry Broda  
  466. X       Department of Psychology
  467. X       University of Illinois at Urbana-Champaign
  468. X       Email: lbroda@s.psych.uiuc.edu
  469. X       4/13/92 
  470. X
  471. X    for GNU emacs information contact:
  472. X    Free Software Foundation
  473. X    675 Massachusetts Avenu
  474. X    Cambridge, MA 02139
  475. X    USA
  476. END_OF_FILE
  477. if test 19631 -ne `wc -c <'HELP-MANUAL'`; then
  478.     echo shar: \"'HELP-MANUAL'\" unpacked with wrong size!
  479. fi
  480. # end of 'HELP-MANUAL'
  481. fi
  482. if test -f 'HELP-WINDOW' -a "${1}" != "-c" ; then 
  483.   echo shar: Will not clobber existing file \"'HELP-WINDOW'\"
  484. else
  485. echo shar: Extracting \"'HELP-WINDOW'\" \(3775 characters\)
  486. sed "s/^X//" >'HELP-WINDOW' <<'END_OF_FILE'
  487. XESC F  More help    | Cursor Motion   |KEY:  ^F Press Control,F keys together
  488. X--------------------|                 |   ESC F  Press ESC key, then F key
  489. XExiting             |     ^P          | type ^C to cancel current command
  490. X                    |      |          |-------------------------------------- 
  491. XESC S  exit/save    | ^B --+-- ^F     | Erase:          | Undeleting/undoing 
  492. XESC Q  quit/no save |      |          |                 |
  493. X--------------------|     ^N          |   ^X character  |   ^Y Undel line/word
  494. XScroll HELP window  |                 |   ^W word       |
  495. X                    |^G/^O word ->/<- |ESC L line       |ESC U Undo last 
  496. XESC F/f  up line/pg |^D/^U page ->/<- |ESC X to end/line|      action 
  497. XESC B/b  back ln/pg |^A/^E bg/end line|ESC K to end/file| (may be repeated)
  498. X------------------------------------------------------------------------------
  499. XOverwrite/Insert    | Motion, Cont.            |   Display Control   
  500. Xmode switch:  ESC N |                          |
  501. X--------------------| ESC A  Beginning of file |    ^R  Redraw screen      
  502. XSearching for text  | ESC E  End of file       | ESC J  Enlarge Edit window  
  503. X                    | ESC G  Goto Line #       | ESC Z  Remove HELP window  
  504. X^S - search forward |--------------------------| ESC H  Restore HELP window 
  505. X^Q - search backward| ESC F / ESC B  HELP->/<- | ESC V  long/short HELP format
  506. X------------------------------------------------------------------------------
  507. XESC Y - Search/Replace: Search for a string and replace it with another
  508. X------------------------------------------------------------------------------
  509. XEasy-edit Manual:  ESC M  Display manual    ESC > / ESC <  Next/Prev subject
  510. X------------------------------------------------------------------------------
  511. XReformatting:                              | Repeat:  
  512. XESC P - reformat paragraph to fill short   | ESC C  Add a repeat count to the
  513. X        lines.                             |        following command. 
  514. X(assumes blank lines between paragraphs    |(e.g. ESC C 9 ESC L kills 9 lines)
  515. X------------------------------------------------------------------------------
  516. XBlocks: ESC / - Mark beginning/end of a text block for a block copy or move
  517. X        ESC + - Insert text block at cursor positoin
  518. X------------------------------------------------------------------------------
  519. XFiles:  ESC I - Insert contents of a file at cursor position
  520. X        ESC D - List a directory for review
  521. X    ESC W - Save your changes without exiting ee.
  522. X    ESC T - Save your editing to a different file (and exit).
  523. X------------------------------------------------------------------------------
  524. XESC R  Recover previous unsaved or aborted edits 
  525. X------------------------------------------------------------------------------
  526. XUnix Commands: ESC ! - (ESC exclamation-point) execute a Unix command, with
  527. X                         the option of inserting the results into your file.
  528. X------------------------------------------------------------------------------
  529. XInformation:   ^T - status   |  ESC @  - Easy-edit license info
  530. X
  531. X* ESC F - Scroll HELP forward    ESC B  - Scroll HELP backward *
  532. X
  533. X   ********************************************************************* 
  534. X   *  Easy-edit (ee) v1.22 --- GNU Emacs-based editor                  *
  535. X   * Copyright (C) 1992     Larry Broda                                *
  536. X   *                        Department of Psychology                   *
  537. X   *                        University of Illinois at Urbana-Champaign *
  538. X   *                                                                   *
  539. X   * type ESC @ for license information                                *
  540. X   ********************************************************************* 
  541. X* ESC F - Scroll HELP forward    ESC B  - Scroll HELP backward *
  542. END_OF_FILE
  543. if test 3775 -ne `wc -c <'HELP-WINDOW'`; then
  544.     echo shar: \"'HELP-WINDOW'\" unpacked with wrong size!
  545. fi
  546. # end of 'HELP-WINDOW'
  547. fi
  548. if test -f 'HELP-WINDOW-ADVANCED' -a "${1}" != "-c" ; then 
  549.   echo shar: Will not clobber existing file \"'HELP-WINDOW-ADVANCED'\"
  550. else
  551. echo shar: Extracting \"'HELP-WINDOW-ADVANCED'\" \(1134 characters\)
  552. sed "s/^X//" >'HELP-WINDOW-ADVANCED' <<'END_OF_FILE'
  553. XESC S  Save/Exit     | ^P  Up        ^U  page->       | ESC N Overwrite/Insert
  554. XESC W  Save/No Exit  | ^N  Down      ^D  page<-       |    ^Y  Undel word/ln
  555. XESC Q  Quit/abort    | ^F  ->     ^A/^E  Beg/End Line | ^X/^W  Del char/word
  556. XESC T  Save to other | ^B  <-     ESC A  Top of file  | ESC L  Del line     
  557. X=====================| ^G  word-> ESC E  end of file  | ESC X  Del->End/line  
  558. XESC F/B HELP up/down | ^O  <-word ESC G  Goto line #  | ESC K  Del->End/file
  559. XESC f/b ... by line  |========================================================
  560. XESC J  Shrink HELP   | ESC U  undo    |^Q/^S <-Search-> | ESC P  Fill paragraph
  561. XESC Z  Remove HELP   |=============== | ESC Y Substitute| ESC I  Insert file   
  562. XESC H  Restore HELP  | ESC R  recover |=================| ESC D  List directory
  563. XESC V  Switch Help   |    ^R  redraw  |ESC / mark block | ESC !  Unix command 
  564. XESC M  Full manual   | ESC C  repeat  |ESC + put block  | ^T     Edit status
  565. X=============================================================================
  566. XEasy-edit 1.22 by Larry Broda, Dept. of Psych. Univ of Il at Champaign-Urbana
  567. Xtype ESC @  for license information
  568. X
  569. END_OF_FILE
  570. if test 1134 -ne `wc -c <'HELP-WINDOW-ADVANCED'`; then
  571.     echo shar: \"'HELP-WINDOW-ADVANCED'\" unpacked with wrong size!
  572. fi
  573. # end of 'HELP-WINDOW-ADVANCED'
  574. fi
  575. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  576.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  577. else
  578. echo shar: Extracting \"'MANIFEST'\" \(406 characters\)
  579. sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  580. X   File Name        Archive #    Description
  581. X-----------------------------------------------------------
  582. X HELP-MANUAL                1    
  583. X HELP-WINDOW                1    
  584. X HELP-WINDOW-ADVANCED       1    
  585. X MANIFEST                   1    
  586. X Makefile.templ             1    
  587. X README                     1    
  588. X easy-edit.man              1    
  589. X easyedit.el                1    
  590. X ee.license                 1    
  591. X ee.sh.template             1    
  592. END_OF_FILE
  593. if test 406 -ne `wc -c <'MANIFEST'`; then
  594.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  595. fi
  596. # end of 'MANIFEST'
  597. fi
  598. if test -f 'Makefile.templ' -a "${1}" != "-c" ; then 
  599.   echo shar: Will not clobber existing file \"'Makefile.templ'\"
  600. else
  601. echo shar: Extracting \"'Makefile.templ'\" \(2932 characters\)
  602. sed "s/^X//" >'Makefile.templ' <<'END_OF_FILE'
  603. X#     Makefile for easy-edit 1.1
  604. X#
  605. X#
  606. X#Easy-edit novice screen editor for Unix systems with GNU emacs
  607. X#
  608. X# Copyright (C) 1992     Larry Broda
  609. X#
  610. X#    This program is distributed in the hope that it will be useful,
  611. X#    but WITHOUT ANY WARRANTY; without even the implied warranty of
  612. X#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  613. X#    GNU General Public License for more details.
  614. X#
  615. X#       By Larry Broda
  616. X#       Department of Psychology
  617. X#       University of Illinois at Urbana-Champaign
  618. X#       Email: lbroda@s.psych.uiuc.edu
  619. X#       4/8/92
  620. X#
  621. X#
  622. X#
  623. X#  STEPS:    1.  Make sure you have GNU emacs installed and working.
  624. X#        2.  Make sure you modify the following variables in this 
  625. X#            Makefile to reflect your system:
  626. X#
  627. X#            EMACS_EXE  -   The path to your GNU emacs executable file
  628. X#            EE_LIBDIR -   The directory where you will keep the
  629. X#                  Easyedit program and documentation files.
  630. X#            EXEDIR    -   The directory where you want the easy-edit
  631. X#                  script installed.
  632. X#            EE_RESUME_CMD -  the command users will use to resume
  633. X#                  ee (emacs) after suspending it with ^Z.
  634. X#                  Will usually be fg or exit.
  635. X#            MAN_DIR    -  Where to put the man pages. (don`t include 
  636. X#                  the section; edit Makefile for other than
  637. X#                  section 1).
  638. X#            
  639. X#            Make sure EE_LIBDIR and EXEDIR exist.
  640. X#
  641. X#        3. Make sure your account has privelege to install the 
  642. X#           programs in the given directories.
  643. X#
  644. X#        4. Do "make easy-edit"
  645. X#        5. Do "make install"
  646. X#        6. Do "make install-man" if you want the man pages installed.
  647. X#
  648. X#
  649. X#  SET THESE TO AGREE WITH YOUR INSTALLATION:
  650. X# 
  651. X# Examples:
  652. X#
  653. X# EMACS_EXE=/usr/local/bin/emacs
  654. X# EXEDIR=/usr/local/bin
  655. X# EMACS_EXE=/usr/local/bin/emacs
  656. X# EE_LIBDIR=/usr/local/lib/easyedit
  657. X# EE_RESUME_CMD=fg
  658. X# MAN_DIR=/usr/local/man
  659. X#
  660. XEMACS_EXE=
  661. XEXEDIR=
  662. XEE_LIBDIR=
  663. XEE_RESUME_CMD=
  664. XMAN_DIR=
  665. X#
  666. X#
  667. X
  668. Xall: easy-edit
  669. X
  670. Xeasy-edit: ee.sh.template
  671. X    echo "#! /bin/sh " > easy-edit
  672. X    echo "# " >> easy-edit
  673. X    echo "export EE_LIB ; EE_LIB=${EE_LIBDIR}" >> easy-edit
  674. X    echo "export EE_RESUME_CMD ; EE_RESUME_CMD=${EE_RESUME_CMD}" >> easy-edit
  675. X    echo "GNUemacs=${EMACS_EXE}" >> easy-edit
  676. X    echo "# " >> easy-edit
  677. X    cat  ee.sh.template >> easy-edit
  678. X
  679. Xinstall: easy-edit
  680. X    cp easyedit.el ${EE_LIBDIR}/easyedit.el
  681. X    cp HELP-WINDOW ${EE_LIBDIR}/HELP-WINDOW
  682. X    cp HELP-WINDOW-ADVANCED ${EE_LIBDIR}/HELP-WINDOW-ADVANCED
  683. X    cp HELP-MANUAL ${EE_LIBDIR}/HELP-MANUAL
  684. X    mv easy-edit ${EXEDIR}/easy-edit
  685. X    rm -f  ${EXEDIR}/ee
  686. X    ln ${EXEDIR}/easy-edit ${EXEDIR}/ee
  687. X    chmod 755 ${EE_LIBDIR}
  688. X    chmod 744 ${EE_LIBDIR}/HELP-WINDOW 
  689. X    chmod 744 ${EE_LIBDIR}/HELP-WINDOW-ADVANCED
  690. X    chmod 744 ${EE_LIBDIR}/HELP-MANUAL 
  691. X    chmod 744 ${EE_LIBDIR}/easyedit.el 
  692. X    chmod 755 ${EE_LIBDIR} 
  693. X    chmod 755 ${EXEDIR}/easy-edit  ${EXEDIR}/ee
  694. Xinstall-man:
  695. X    rm -f ${MAN_DIR}/man1/ee.1
  696. X    cp easy-edit.man ${MAN_DIR}/man1/easy-edit.1
  697. X    ln ${MAN_DIR}/man1/easy-edit.1 ${MAN_DIR}/man1/ee.1
  698. X    chmod 744 ${MAN_DIR}/man1/easy-edit.1 ${MAN_DIR}/man1/ee.1
  699. Xclean:
  700. X    rm easy-edit
  701. END_OF_FILE
  702. if test 2932 -ne `wc -c <'Makefile.templ'`; then
  703.     echo shar: \"'Makefile.templ'\" unpacked with wrong size!
  704. fi
  705. # end of 'Makefile.templ'
  706. fi
  707. if test -f 'README' -a "${1}" != "-c" ; then 
  708.   echo shar: Will not clobber existing file \"'README'\"
  709. else
  710. echo shar: Extracting \"'README'\" \(5485 characters\)
  711. sed "s/^X//" >'README' <<'END_OF_FILE'
  712. X        Easy-edit v1.23              by Larry Broda
  713. X===================================================================
  714. X
  715. X    Easy-edit (or "ee") is a simple text editor for novice users.
  716. XIt is designed to be usable with no training at all, and it was
  717. Xdesigned primarily for a Unix user community who used the system for
  718. Xe-mail and little else, and are not willing or do not have the time to
  719. Xlearn vi or emacs to edit their mail messages.  (At our installation,
  720. Xeven computer-shy users who were afraid of Unix or vi and emacs began
  721. Xediting when ee was introduced.  The response from such people, who
  722. Xranged from secretaries to professors, was quite positive).
  723. X
  724. X    When used as the default editor in Elm, it makes for a very
  725. Xeasy-to-use mail system requiring a mininum of user education.
  726. X
  727. X    Easy-edit is a major-mode of GNU Emacs.  As such it avoids many
  728. Xof the screen/keyboard handling bugs in custom-written editors of this sort,
  729. Xas that work is actually done by Emacs.  Ee splits the editing
  730. Xscreen into two windows; in the top window, the file is edited, and in
  731. Xthe bottom window (called the "HELP" window), a list of editing
  732. Xcommands is displayed.  The HELP window may be scrolled up and down to
  733. Xdisplay everything the ee user needs to know to edit a file; however,
  734. Xusually the first HELP page contains enough to edit, and the susequent
  735. Xones reveal more advanced commands.  The editor itself contains most
  736. Xdesirable simple editing commands for insertion, deletion, searching,
  737. Xand even text-justification.
  738. X
  739. X    Advanced users may choose a more concise HELP window display,
  740. Xor may eliminate the HELP window completely (the HELP window may also
  741. Xbe shrunk to make more room for the file window).  A full-text manual
  742. Xcan also be displayed in the HELP window.
  743. X
  744. X    Easy-edit can be installed for an entire system by the system 
  745. Xmanager, or by individuals in their own accounts for personal use, as long
  746. Xas the system has GNU emacs.  
  747. X
  748. X    Easy-edit consists of the following files:
  749. X
  750. X
  751. Xeasyedit.el           The Emacs-lisp program file.  When loaded into Emacs,
  752. X                      easy-edit mode is enabled.
  753. X
  754. XHELP-WINDOW           The default HELP window display
  755. XHELP-WINDOW-ADVANCED  The advanced HELP window display 
  756. XHELP-MANUAL           The full text manual HELP window display
  757. X
  758. Xeasy-edit             The Bourne shell script file used to call
  759. X                      easy-edit.  This script calls emacs with the
  760. X                  arguments to bring up easy-edit mode. This
  761. X                      script is generated by the makefile to use
  762. X                      to the site-define directories.
  763. X
  764. Xee.sh.template        The template for the sh script, used by the
  765. X                      Makefile to create easy-edit.
  766. X
  767. Xee                    A link to easy-edit, created by the Makefile,
  768. X                      provided as a convenient abbreviation.
  769. X
  770. Xeasy-edit.man          The man page for easy-edit
  771. X
  772. Xee.license          Copyright/license info
  773. X
  774. XInstallation
  775. X===========
  776. X
  777. XRequirements:  GNU Emacs.
  778. X
  779. X    Easy-edit was designed with GNU Emacs version 18.57 and 18.58,
  780. Xand is untested with other versions.
  781. X    Ee assumes that  it is running on a Unix system with BSD/csh
  782. Xtype process control facilities.  Some commands may not behave properly
  783. Xon other types of systems (esp, ^Z, ESC D, and ESC !).
  784. X
  785. X
  786. XProcedure:
  787. X=========
  788. X
  789. X1. Edit the Makefile
  790. X
  791. XCopy Makefile.templ to Makefile and change path variables to reflect 
  792. Xyour system according to the instructions at the top of the file.  It
  793. Xis recommended that you create a new directory for EE_LIBDIR, where the
  794. Xprogram and HELP files are stored.  Be sure the full pathname for your
  795. XEmacs executable is given where required.
  796. X
  797. XThe variable EE_RESUME_CMD should be set to reflect the command that
  798. Xis issued to resume a suspended process.  On most systems, it will be 
  799. Xprobably be "fg"; if your system suspends Emacs by forking a shell, this
  800. Xwill be "exit".  The sole purpose of this variable is to issue an 
  801. Xinformational message to users who suspend Ee reminding them how to start
  802. Xit again.
  803. X
  804. XCreate the directories for EE_LIBDIR and EXEDIR if they do not exist.
  805. X
  806. X2. Do a "make easy-edit" 
  807. X
  808. XThis will create the shell script "easy-edit".
  809. X
  810. X3. Do a "make install"
  811. XThis will mv easy-edit to the specified directory, create "ee", which
  812. Xwill be a hard link to easy-edit, and copy the easyedit.el and HELP
  813. Xfiles into the EE_LIBDIR directory.
  814. X
  815. X4. If you want man pages, do a "make install-man"
  816. X
  817. X5. Give it a try.
  818. X
  819. X
  820. XEasy-edit novice screen editor for Unix systems with GNU emacs
  821. X
  822. X     Easy-edit 1.23
  823. X
  824. X     Copyright (C) 1992     Larry Broda
  825. X                            Department of Psychology
  826. X                            University of Illinois at Urbana-Champaign
  827. X
  828. X    This program is distributed in the hope that it will be useful, 
  829. X    but WITHOUT ANY WARRANTY; without even the implied warranty of 
  830. X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  This program  
  831. X    is an extension of GNU emacs; See the GNU General Public License  
  832. X    for more details. 
  833. X
  834. X    This program is free software; you can redistribute it and/or modify
  835. X    it under the same terms as the GNU General Public License as published by
  836. X    the Free Software Foundation either version 1, or (at your option)
  837. X    any later version.
  838. X
  839. X       By Larry Broda  
  840. X       Department of Psychology
  841. X       University of Illinois at Urbana-Champaign
  842. X       Email: lbroda@s.psych.uiuc.edu
  843. X       4/13/92 
  844. X
  845. X    for GNU emacs information contact:
  846. X    Free Software Foundation
  847. X    675 Massachusetts Avenu
  848. X    Cambridge, MA 02139
  849. X    USA
  850. END_OF_FILE
  851. if test 5485 -ne `wc -c <'README'`; then
  852.     echo shar: \"'README'\" unpacked with wrong size!
  853. fi
  854. # end of 'README'
  855. fi
  856. if test -f 'easy-edit.man' -a "${1}" != "-c" ; then 
  857.   echo shar: Will not clobber existing file \"'easy-edit.man'\"
  858. else
  859. echo shar: Extracting \"'easy-edit.man'\" \(2863 characters\)
  860. sed "s/^X//" >'easy-edit.man' <<'END_OF_FILE'
  861. X.TH name l "2 July 1992"
  862. X.SH NAME 
  863. XEasy-edit \- Split-window editor with Help window
  864. X.SH SYNOPSIS
  865. X.B easy-edit [ -e ][ -z ] file    or
  866. X.LP
  867. X.B ee [ -e ][ -z ] file
  868. X.SH DESCRIPTION
  869. XEasy-edit, or "ee", is a simple editor designed to be usable by persons with 
  870. Xno experience who need to do quick editing for mail or other needs and
  871. Xdo not wish to invest the time needed to learn traditional Unix editors.
  872. XEe splits the terminal screen into two windows, and editing window and a
  873. XHELP window which lists editing commands.  Thus all the reference
  874. Xinformation needed for editing is always available online, meaning that
  875. Xa complete novice should be able to invoke ee and begin editing
  876. Ximmediately.
  877. X.PD
  878. X.PP
  879. XUsing Easy-edit can be as simple as invoking it with a filename, typing
  880. Xin text (line-wraps are automatically inserted), and saving it with an
  881. XESC S command.  More complex editing functions are performed with either
  882. Xcontrol-keys (the control key pressed simultaneously with another key),
  883. Xor escape sequences (the ESC key followed by another key).  
  884. X
  885. X.PP
  886. XOnce familiar with the editing commands, the ee user may switch to a
  887. Xmore concise HELP window listing with the ESC V commands, or invoke ee
  888. Xwith the -e option (ee -e filename) to get the concise help listing at
  889. Xthe outset.  The -z option allows ee to be started with no help window; 
  890. Xthe HELP window may still be restored with the ESC H command, however.
  891. XA full-text manual may also be displayed.  There are
  892. Xcommands to shrink or eliminate the HELP window for experienced users
  893. Xwho wish to have a larger editing display (the HELP window can always be
  894. Xrestored with an ESC H).
  895. X
  896. XEasy-edit is a major mode of GNU Emacs.  
  897. X.PD
  898. X.PP
  899. X.SH EXAMPLES
  900. XTo edit the file "newfile":
  901. X
  902. X    ee newfile
  903. X
  904. XTo edit the file "oldfile", with the advanced HELP window listing:
  905. X
  906. X    ee -e oldfile
  907. X.PD
  908. X.PP
  909. X.SH FILES
  910. X.PD 0
  911. X.TP 22
  912. Xeasy-edit 
  913. X- The script which calls GNU emacs and loads the easy-edit
  914. Xconfiguration.
  915. X.PD 0
  916. X.TP 22
  917. XHELP-WINDOW
  918. X- The standard HELP window display
  919. X.PD 0
  920. X.TP 22
  921. XHELP-WINDOW-ADVANCED
  922. X- The advanced HELP display
  923. X.PD 0
  924. X.TP 22
  925. XHELP-MANUAL
  926. X- the manual display
  927. X.PD 0
  928. X.TP 22
  929. Xeasyedit.el
  930. X- The emacs lisp program which puts emacs in easy-edit mode.
  931. X.SH SEE ALSO
  932. Xemacs(1)
  933. X.PD
  934. X.PP
  935. X.PP
  936. X.SH WARNINGS
  937. XIf for some reason the the easy-edit.el file cannot be loaded, or if
  938. Xthere is a bug in this file, the user can be left in regular emacs with
  939. Xno indication as to how to exit, or even with the regular emacs keys
  940. Xunbound but the easy-edit keys not yet bound (and thus no way to exit).
  941. XUsually in this case a ^Z will still suspend ee/emacs, allowing the
  942. Xprocess to then be killed.
  943. X.PD
  944. X.PP
  945. X.SH AUTHOR
  946. X.nf
  947. X    Larry Broda
  948. X    Department of Psychology
  949. X    University of Illinois at Urbana-Champaign
  950. X    Champaign, Il
  951. X
  952. X    GNU Emacs was written by
  953. X    primarily by Richard Stallman,
  954. X    Free Software Foundation
  955. X    675 Massachusetts Ave.
  956. X    Cambridge,  MA  02139
  957. END_OF_FILE
  958. if test 2863 -ne `wc -c <'easy-edit.man'`; then
  959.     echo shar: \"'easy-edit.man'\" unpacked with wrong size!
  960. fi
  961. # end of 'easy-edit.man'
  962. fi
  963. if test -f 'easyedit.el' -a "${1}" != "-c" ; then 
  964.   echo shar: Will not clobber existing file \"'easyedit.el'\"
  965. else
  966. echo shar: Extracting \"'easyedit.el'\" \(45297 characters\)
  967. sed "s/^X//" >'easyedit.el' <<'END_OF_FILE'
  968. X(setq ee-VERSION "1.23")
  969. X
  970. X;                    Easy-Edit  1.23       GNU Emacs configuration
  971. X;            7/2/92
  972. X;
  973. X;
  974. X; Easy-edit novice screen editor for Unix systems with GNU emacs
  975. X;
  976. X; Copyright (C) 1992     Larry Broda
  977. X;                      
  978. X;
  979. X;    This program is distributed in the hope that it will be useful,
  980. X;    but WITHOUT ANY WARRANTY; without even the implied warranty of
  981. X;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  This program 
  982. X;    is an extension of GNU emacs; See the GNU General Public License 
  983. X;    for more details.
  984. X;
  985. X;    This program is free software; you can redistribute it and/or modify
  986. X;    it under the same terms as the GNU General Public License as 
  987. X;    published by the Free Software Foundation; either version 1, or 
  988. X;    (at your option) any later version.
  989. X;
  990. X;
  991. X;
  992. X;    Easy-edit 1.23
  993. X;       By Larry Broda  
  994. X;    Department of Psychology
  995. X;    University of Illinois at Urbana-Champaign
  996. X;       Email: lbroda@s.psych.uiuc.edu
  997. X;    4/13/92 
  998. X;
  999. X;    GNU emacs information:
  1000. X;    contact:
  1001. X;    Free Software Foundation
  1002. X;    675 Massachusetts Avenu
  1003. X;    Cambridge, MA 02139
  1004. X;    USA
  1005. X
  1006. X(defconst ee-com-map nil
  1007. X  "Keymap for easyedit")
  1008. X;
  1009. X; Function to give an error message for using an key out of context
  1010. X;
  1011. X(defun ee-not-here ()
  1012. X  "That key unbound at moment"
  1013. X  (interactive)
  1014. X  (ding))
  1015. X
  1016. X;
  1017. X; 
  1018. X;
  1019. X
  1020. X(defun ee-nofun ()
  1021. X  "function to give an error for an unbound key"
  1022. X  (interactive)
  1023. X  (message "Not currently an easy-edit command" (ding))
  1024. X  (sleep-for 2)
  1025. X  (ee-message HELP_HELP))
  1026. X
  1027. X
  1028. X(defun ee-quit ()
  1029. X  "Exit without saving"
  1030. X  (interactive)    
  1031. X  (progn
  1032. X    (if (buffer-modified-p (get-buffer "EDIT"))
  1033. X    (progn
  1034. X      (cond 
  1035. X       ((yes-or-no-p "Really quit and cancel changes? " ) 
  1036. X        (message "Cancelling changes!")
  1037. X        (sleep-for 1)
  1038. X        (discard-input)
  1039. X        (kill-emacs))
  1040. X       ((ee-message HELP_HELP))))
  1041. X      (message "No changes to cancel...")
  1042. X      (sleep-for 1)
  1043. X      (discard-input)
  1044. X      (kill-emacs))))
  1045. X
  1046. X(defun ee-kill-to-eof ()
  1047. X  "Delete from point to End of buffer"
  1048. X  (interactive)
  1049. X  (end-of-buffer)
  1050. X  (delete-region (point) (mark)))
  1051. X
  1052. X(defun ee-move-block ()
  1053. X  "Demark a block of text and copy or move it"
  1054. X  (interactive)
  1055. X  (if (> ee-BLOCK-MARK 0)
  1056. X     (progn 
  1057. X
  1058. X       (let ((imsg "
  1059. X         Type  m  to move the block (delete original)
  1060. X         Type  c  to copy the block (leave original)
  1061. X
  1062. X                 Type ESC +  when ready to insert the block at cursor
  1063. X
  1064. X                 ... you may continue to insert the block repeatedly
  1065. X                     until you mark another block.")
  1066. X         (iprmpt "Choose m or c, please: "))
  1067. X
  1068. X         (setq DELFLG (eq (ee-choosefrom-list imsg iprmpt '(?c ?m)) ?m)))
  1069. X
  1070. X       (copy-to-register ?b ee-BLOCK-MARK (point) DELFLG)
  1071. X       (setq ee-BLOCK-MARK 0)
  1072. X       (message "type ESC + to insert block at cursor location")
  1073. X       (setq ee-BLOCK-SAVED 'true)
  1074. X       (ding))
  1075. X
  1076. X    (setq ee-BLOCK-MARK (point))
  1077. X    (setq ee-BLOCK-SAVED 'nil)
  1078. X    (message "Move cursor to other end of text block and press ESC / again")
  1079. X    (ding)
  1080. X    (sleep-for 2)))
  1081. X
  1082. X;
  1083. X; Code from GNU Emacs: ee-query-replace and ee-perform-replace are modifications by
  1084. X; Larry Broda, Dept. of Psychology/University of Illinois at C-U, of the
  1085. X; functions query-replace and perform-replace from the GNU Emacs distribution, and are subject
  1086. X; to all terms of the GNU Emacs Public License.
  1087. X;
  1088. X
  1089. X(defun ee-query-replace (from-string to-string &optional arg)
  1090. X  "\
  1091. XReplace some occurrences of FROM-STRING with TO-STRING.
  1092. XAs each match is found, the user must type a character saying
  1093. Xwhat to do with it.  
  1094. XPreserves case in each replacement if  case-replace  and  case-fold-search
  1095. Xare non-nil and FROM-STRING has no uppercase letters.
  1096. XThird arg DELIMITED (prefix arg if interactive) non-nil means replace
  1097. Xonly matches surrounded by word boundaries."
  1098. X  (interactive "sQuery replace: \nsQuery replace %s with: \nP")
  1099. X  (ee-perform-replace from-string to-string t nil arg)
  1100. X  (message "Done"))
  1101. X
  1102. X(defun ee-perform-replace (from-string to-string
  1103. X                query-flag regexp-flag delimited-flag)
  1104. X  (let ((nocasify (not (and case-fold-search case-replace
  1105. X                (string-equal from-string
  1106. X                      (downcase from-string)))))
  1107. X    (literal (not regexp-flag))
  1108. X    (search-function (if regexp-flag 're-search-forward 'search-forward))
  1109. X    (search-string from-string)
  1110. X    (keep-going t)
  1111. X    (lastrepl nil))            ;Position after last match considered.
  1112. X    (if delimited-flag
  1113. X    (setq search-function 're-search-forward
  1114. X          search-string (concat "\\b"
  1115. X                    (if regexp-flag from-string
  1116. X                      (regexp-quote from-string))
  1117. X                    "\\b")))
  1118. X    (push-mark)
  1119. X    (push-mark)
  1120. X    (while (and keep-going
  1121. X        (not (eobp))
  1122. X        (progn
  1123. X         (set-mark (point))
  1124. X         (funcall search-function search-string nil t)))
  1125. X      ;; Don't replace the null string 
  1126. X      ;; right after end of previous replacement.
  1127. X      (if (eq lastrepl (point))
  1128. X      (forward-char 1)
  1129. X    (undo-boundary)
  1130. X    (if (not query-flag)
  1131. X        (replace-match to-string nocasify literal)
  1132. X      (let (done replaced)
  1133. X        (while (not done)
  1134. X          ;; Preserve the match data.  Process filters and sentinels
  1135. X          ;; could run inside read-char..
  1136. X;          (let ((data (match-data))
  1137. X;            (help-form
  1138. X;             '(concat "Query replacing "
  1139. X;                  (if regexp-flag "regexp " "")
  1140. X;                  from-string " with " to-string ".\n\n"
  1141. X;                  (substitute-command-keys query-replace-help))))
  1142. X;        (setq char help-char)
  1143. X;        (while (= char help-char)
  1144. X;          (message "Query replacing %s with %s: " from-string to-string)
  1145. X;          (setq char (read-char))
  1146. X;          (if (= char ??)
  1147. X;              (setq unread-command-char help-char char help-char)))
  1148. X;        (store-match-data data))
  1149. X
  1150. X         
  1151. X        (message "Query replacing %s with %s: " from-string to-string)
  1152. X        (setq char (read-char))
  1153. X
  1154. X          (cond ((or (= char ?\e)
  1155. X             (= char ?q))
  1156. X             (setq keep-going nil)
  1157. X             (setq done t))
  1158. X            ((= char ?y)
  1159. X             (or replaced
  1160. X             (replace-match to-string nocasify literal))
  1161. X             (setq done t))
  1162. X            ((= char ?\.)
  1163. X             (or replaced
  1164. X             (replace-match to-string nocasify literal))
  1165. X             (setq keep-going nil)
  1166. X             (setq done t))
  1167. X            ((= char ?!)
  1168. X             (or replaced
  1169. X             (replace-match to-string nocasify literal))
  1170. X             (setq done t query-flag nil))
  1171. X            ((= char ?n)
  1172. X             (setq done t))
  1173. X            ((= char ?\C-l)
  1174. X             (recenter nil))
  1175. X            (t
  1176. X             (message "Not a choice")
  1177. X             (ding)
  1178. X             (sleep-for 2))))))
  1179. X    (setq lastrepl (point))))
  1180. X    (pop-mark)
  1181. X    keep-going))
  1182. X
  1183. X(defun ee-search-replace ()
  1184. X  "Do a text search/replace"
  1185. X  (interactive)
  1186. X  (setq sprompt (concat "Replace-> [" search-last-string "]: "))
  1187. X  (setq sstring (read-string sprompt))
  1188. X  (if (> (length sstring) 0)
  1189. X      (setq search-last-string sstring)
  1190. X    (setq sstring search-last-string))
  1191. X  
  1192. X    (if (> (length sstring) 0)
  1193. X    (progn
  1194. X      (setq rstring (read-string "Replace with-> "))
  1195. X      (save-window-excursion
  1196. X        (with-output-to-temp-buffer "*INFORMATION*"
  1197. X          (save-excursion
  1198. X        (set-buffer "*INFORMATION*")
  1199. X        (erase-buffer))
  1200. X          (princ "             Search/Replace\n\n")
  1201. X          (princ (concat "Replace all occurrences of " sstring " with " rstring "\n"))
  1202. X          (princ "from the current position to the end of file.\n")
  1203. X          (princ "(use confirm if you don't want to replace every occurrence)\n\n")
  1204. X          (princ "Type y for confirm (will ask before doing each replacement)\n")
  1205. X          (princ "Type n to do all replacements without confirming\n"))
  1206. X        (setq SRFLG ?x)
  1207. X        (while (not (ee-member SRFLG '(?y ?n)))
  1208. X          (progn
  1209. X        (let ((cursor-in-echo-area t))
  1210. X          (message "Confirm replacements (y or n)? ")
  1211. X          (ding)
  1212. X          (setq SRFLG (downcase (read-char))))
  1213. X        (let ((cursor-in-echo-area nil))
  1214. X          (cond
  1215. X         ((eq SRFLG ?y)
  1216. X          (with-output-to-temp-buffer "*INFORMATION*"
  1217. X            (save-excursion
  1218. X              (set-buffer "*INFORMATION*")
  1219. X              (erase-buffer))
  1220. X            (princ "Choices for answering replace query: \n\n")
  1221. X            (princ "(press ESC or q to stop the search/replace at any time)\n\n")
  1222. X            (princ "  y     - do the replacement and continue searching\n")
  1223. X            (princ "  n     - don't replace, but continue searching\n")
  1224. X            (princ "  .     - Replace this occurrence and stop\n")
  1225. X            (princ "  q     - Don't replace, and stop\n")
  1226. X            (princ "  !     - replace all occurrences from here on without confirming\n"))
  1227. X          (ee-query-replace sstring rstring nil))
  1228. X         ((eq SRFLG ?n)  (replace-string sstring rstring))
  1229. X         (t  (message "Type y for confirm, n for no confirm, please")
  1230. X             (sleep-for 2))))))))))
  1231. X
  1232. X(defun ee-insert-block ()
  1233. X  "Insert block"
  1234. X  (interactive)
  1235. X
  1236. X  (if (null ee-BLOCK-SAVED )
  1237. X      (progn
  1238. X        (message "No block has been marked and saved with ESC /")
  1239. X        (ding))
  1240. X    (insert-register ?b)))
  1241. X    
  1242. X
  1243. X(defun ee-recover ()
  1244. X  "recover from an Emacs auto-save file"
  1245. X  (interactive)
  1246. X  (ee-recover-file EE_FILE_NAME)
  1247. X  (auto-save-mode 1)
  1248. X  (easyedit-mode))
  1249. X
  1250. X;
  1251. X; following function derived from GNU Emacs recover-file function, by
  1252. X; Richard Stallman
  1253. X;
  1254. X(defun ee-recover-file (file)
  1255. X  "Visit file FILE, but get contents from its last auto-save file."
  1256. X  (interactive "FRecover file: ")
  1257. X  (setq file (expand-file-name file))
  1258. X  (if (auto-save-file-name-p file) (error "%s is an auto-save file" file))
  1259. X  (let ((file-name (let ((buffer-file-name file))
  1260. X             (make-auto-save-file-name))))
  1261. X    (cond ((not (file-newer-than-file-p file-name file))
  1262. X       (error "Auto-save file %s not current" file-name))
  1263. X       ((yes-or-no-p "Recover previous unsaved edits? " ) 
  1264. X        (switch-to-buffer (find-file-noselect file t))
  1265. X        (let ((buffer-read-only nil))
  1266. X         (erase-buffer)
  1267. X         (insert-file-contents file-name nil))
  1268. X        (after-find-file nil))
  1269. X        (t (error "Recovery cancelled.")))
  1270. X  (setq buffer-auto-save-file-name nil)))
  1271. X  
  1272. X(defun ee-check-recovery-file (file)
  1273. X  "Print a nicer message if the save file is current"
  1274. X  (interactive)
  1275. X  (setq file (expand-file-name file))
  1276. X  (if (auto-save-file-name-p file) (error "%s is an auto-save file" file))
  1277. X  (let ((file-name (let ((buffer-file-name file))
  1278. X             (make-auto-save-file-name))))
  1279. X    (cond ((file-newer-than-file-p file-name file)
  1280. X           (message "Found recovery file from unsaved edit; consider ESC R to recover.")
  1281. X            (ding)
  1282. X            (sleep-for 4)))))
  1283. X
  1284. X(defun ee-suspend-edit ()
  1285. X  "suspend"
  1286. X  (interactive)
  1287. X  (progn
  1288. X    (suspend-emacs EE_RESUME_MSG)
  1289. X    (ee-message HELP_HELP)))
  1290. X
  1291. X(defun ee-create-help ()
  1292. X  "Create the help window"
  1293. X  (progn
  1294. X    (setq EEHELPF
  1295. X      (cond
  1296. X       ((setq temp (getenv "EASYEDIT_HELP")) temp)
  1297. X       (t "/usr/local/lib/easyedit/HELP-WINDOW")))
  1298. X    (setq ALTERNATE_HELP (concat EEHELPF "-ADVANCED"))
  1299. X    (setq EASYEDIT_MANUAL
  1300. X      (cond
  1301. X       ((setq temp (getenv "EASYEDIT_MANUAL")) temp)
  1302. X       (t "/usr/local/lib/easyedit/HELP-MANUAL")))
  1303. X    (if (string-equal (getenv "HELP_LEVEL") "advanced")
  1304. X    (progn
  1305. X      (setq temp ALTERNATE_HELP)
  1306. X      (setq ALTERNATE_HELP EEHELPF)
  1307. X      (setq EEHELPF temp)))
  1308. X    (if (file-exists-p EEHELPF)
  1309. X    (progn
  1310. X      (setq ee-HWIN (split-window nil nil nil))
  1311. X      (select-window ee-HWIN)
  1312. X      (switch-to-buffer "HELP")
  1313. X      (insert-file-contents EEHELPF)
  1314. X      (setq buffer-read-only t)
  1315. X      (select-window ee-EWIN))
  1316. X      (message "HELP FILE NOT FOUND!")
  1317. X      (ding)
  1318. X      (sleep-for 3)
  1319. X      (discard-input)
  1320. X      (kill-emacs))))
  1321. X
  1322. X(defun ee-switch-help ()
  1323. X  "toggle between the advanced and basic help files"
  1324. X  (interactive)
  1325. X  (if (not (file-exists-p ALTERNATE_HELP))
  1326. X      (progn
  1327. X    (message "Alternate help file not found!")
  1328. X    (ding))
  1329. X    (define-key ee-com-map "\e>" 'ee-not-manual)
  1330. X    (define-key ee-com-map "\e<" 'ee-not-manual)
  1331. X    (set-buffer "HELP")
  1332. X    (setq buffer-read-only nil)
  1333. X    (erase-buffer)
  1334. X    (insert-file-contents ALTERNATE_HELP)
  1335. X    (setq buffer-read-only t)
  1336. X    (set-buffer "EDIT")
  1337. X    (setq temp ALTERNATE_HELP)
  1338. X    (setq ALTERNATE_HELP EEHELPF)
  1339. X    (setq EEHELPF temp)))
  1340. X
  1341. X(defun ee-manual ()
  1342. X  "replace HELP with MANUAL display"
  1343. X  (interactive)
  1344. X  (if (not (file-exists-p EASYEDIT_MANUAL))
  1345. X      (progn
  1346. X    (message "Easy-edit manual file not found!")
  1347. X    (ding))
  1348. X    (set-buffer "HELP")
  1349. X    (let ((buffer-read-only nil))
  1350. X      (erase-buffer)
  1351. X      (insert-file-contents EASYEDIT_MANUAL))
  1352. X    (set-buffer "EDIT")
  1353. X    (define-key ee-com-map "\e>" 'ee-next-subject)
  1354. X    (define-key ee-com-map "\e<" 'ee-previous-subject)
  1355. X    (setq HELP_HELP "ESC F/B scroll fwd/bkwd;  ESC H - restore HELP")
  1356. X    (ee-message HELP_HELP)))
  1357. X
  1358. X(defun ee-insert-file ()
  1359. X  "Insert file"
  1360. X  (interactive)
  1361. X  (setq ifile (read-string "File to insert: "))
  1362. X  (if (> (length ifile) 0) 
  1363. X(let ((default-directory "./"))
  1364. X(insert-file-contents ifile)))
  1365. X  (ee-message HELP_HELP))
  1366. X
  1367. X(defun ee-search-forward ()
  1368. X  "search forward"
  1369. X  (interactive)
  1370. X  (setq sprompt (concat "Find-> [" search-last-string "]: "))
  1371. X  (setq sstring (read-string sprompt))
  1372. X  (if (> (length sstring) 0) (setq search-last-string sstring)) 
  1373. X  (search-forward search-last-string))
  1374. X
  1375. X(defun ee-search-backward ()
  1376. X  "search forward"
  1377. X  (interactive)
  1378. X  (setq sprompt (concat "<-Find [" search-last-string "]: "))
  1379. X  (setq sstring (read-string sprompt))
  1380. X  (if (> (length sstring) 0) (setq search-last-string sstring)) 
  1381. X  (search-backward search-last-string))
  1382. X
  1383. X(defun ee-message (ee_txt)
  1384. X  "write an easy-edit message at bottom of screen"
  1385. X  (interactive)
  1386. X  (message (concat EE_FILE_NAME (concat EE_MODE  (concat " ---- " ee_txt)))))
  1387. X
  1388. X(defun ee-upp-help ()
  1389. X  "Scroll help window upwards"
  1390. X  (interactive)
  1391. X  (if (window-point ee-HWIN)
  1392. X      (progn
  1393. X    (select-window ee-HWIN)
  1394. X    (setq HWSIZE (- (window-height) 1))
  1395. X    (select-window ee-EWIN)
  1396. X    (scroll-other-window (* -1 HWSIZE)))
  1397. X    (message "No HELP window to scroll")
  1398. X    (ding)
  1399. X    (sleep-for 2))
  1400. X  (ee-message HELP_HELP))
  1401. X
  1402. X(defun ee-downp-help ()
  1403. X  "Scroll help window upwards"
  1404. X  (interactive)
  1405. X  (if (window-point ee-HWIN)
  1406. X      (progn
  1407. X    (select-window ee-HWIN)
  1408. X    (setq HWSIZE (- (window-height) 1))
  1409. X    (select-window ee-EWIN)
  1410. X    (scroll-other-window HWSIZE))
  1411. X    (message "No HELP window to scroll")
  1412. X    (ding)
  1413. X    (sleep-for 2))
  1414. X  (ee-message HELP_HELP))
  1415. X
  1416. X
  1417. X(defun ee-upl-help ()
  1418. X  "Scroll help window upwards"
  1419. X  (interactive)
  1420. X  (if (window-point ee-HWIN)
  1421. X      (scroll-other-window -1)
  1422. X    (message "No HELP window to scroll")
  1423. X    (ding)
  1424. X    (sleep-for 2))
  1425. X  (ee-message HELP_HELP))
  1426. X
  1427. X(defun ee-downl-help ()
  1428. X  "Scroll help window upwards"
  1429. X  (interactive)
  1430. X  (if (window-point ee-HWIN)
  1431. X      (scroll-other-window 1)
  1432. X    (message "No HELP window to scroll")
  1433. X    (ding)
  1434. X    (sleep-for 2))
  1435. X  (ee-message HELP_HELP))
  1436. X
  1437. X
  1438. X(defun ee-kill-line (cnt)
  1439. X  "Delete a line"
  1440. X  (interactive "P")
  1441. X  (progn 
  1442. X    (beginning-of-line)
  1443. X    (kill-line (if (eq cnt nil) 1 cnt))))
  1444. X
  1445. X(defun ee-restore-help ()
  1446. X  "restore a lost help window"
  1447. X  (interactive)
  1448. X  (progn
  1449. X    (define-key ee-com-map "\e>" 'ee-not-manual)
  1450. X    (define-key ee-com-map "\e<" 'ee-not-manual)
  1451. X    (switch-to-buffer "EDIT")
  1452. X    (delete-other-windows)
  1453. X    (setq ee-HWIN (split-window nil nil nil))
  1454. X    (select-window ee-HWIN)
  1455. X    (switch-to-buffer "HELP")
  1456. X    (let ((buffer-read-only nil))
  1457. X      (erase-buffer)
  1458. X      (insert-file-contents EEHELPF))
  1459. X    (select-window ee-EWIN)
  1460. X    (setq HELP_HELP "ESC F / ESC B -> HELP forward / backward")
  1461. X    (ee-message HELP_HELP)))
  1462. X
  1463. X(defun ee-zap-help ()
  1464. X  "Remove the HELP window"
  1465. X  (interactive)
  1466. X  (progn
  1467. X    (delete-other-windows)
  1468. X    (switch-to-buffer "EDIT")
  1469. X    (setq HELP_HELP "To display HELP window: ESC H")
  1470. X    (ee-message HELP_HELP)))
  1471. X
  1472. X  ;
  1473. X  ;
  1474. X  ; display the *INFORMATION* window with the mesg "mesg", for 
  1475. X  ; duration seconds.  If duration =0, display it until a character is typed
  1476. X  ; if cmd is non-nil, execute the function
  1477. X  ;
  1478. X(defun ee-INFO (mesg)
  1479. X  (save-window-excursion
  1480. X    (with-output-to-temp-buffer "*INFORMATION*"
  1481. X      (save-excursion
  1482. X    (set-buffer "*INFORMATION*")
  1483. X    (erase-buffer)
  1484. X    )
  1485. X      (princ "\n\n")
  1486. X      (princ mesg))
  1487. X    (let ((cursor-in-echo-area t))
  1488. X      (message "Type any character to continue: ")(read-char))
  1489. X    ))
  1490. X
  1491. X
  1492. X;
  1493. X; this command displays "mesg" in a tien INFORMATION window,
  1494. X; and prompts for a character which must be a member of choices, using
  1495. X; the prompt string "prompt" to prompt for it
  1496. X;
  1497. X(defun ee-choosefrom-list (mesg prompt choices)
  1498. X  (progn
  1499. X      (save-window-excursion
  1500. X    (with-output-to-temp-buffer "*INFORMATION*"
  1501. X      (save-excursion
  1502. X        (set-buffer "*INFORMATION*")
  1503. X        (erase-buffer)
  1504. X        )
  1505. X      (princ "\n\n")
  1506. X      (princ mesg))
  1507. X    (let ((cursor-in-echo-area t))
  1508. X      (setq achar '(x))
  1509. X      (while (not (ee-member achar choices))
  1510. X        (message prompt)
  1511. X        (ding)
  1512. X        (setq achar (downcase (read-char)))))
  1513. X    )
  1514. X      achar))
  1515. X
  1516. X(defun ee-member (item list)
  1517. X  "is item in list?"
  1518. X  (cond
  1519. X   ((null list)  nil)
  1520. X   ((eq item (car list))   list)
  1521. X   (t        (ee-member item (cdr list)))))
  1522. X
  1523. X(defun ee-status ()
  1524. X  "status "
  1525. X  (interactive)
  1526. X  (progn
  1527. X    (setq IMSG
  1528. X      (concat (current-time-string) "
  1529. X
  1530. XYou are editing "  buffer-file-name "
  1531. X
  1532. XFile editing status: " (cond ((buffer-modified-p (get-buffer "EDIT")) "Modified")
  1533. X             (t "Not modified")) "
  1534. X
  1535. X(type ESC @ for easy-edit license information)"))
  1536. X    (ee-INFO IMSG)))
  1537. X
  1538. X(defun ee-get-arg (mesg prompt)
  1539. X  (let (char)
  1540. X      (save-window-excursion
  1541. X(with-output-to-temp-buffer "*INFORMATION*"
  1542. X  (save-excursion
  1543. X    (set-buffer "*INFORMATION*")
  1544. X    (erase-buffer)
  1545. X    )
  1546. X  (princ mesg))
  1547. X(let ((cursor-in-echo-area t))
  1548. X  (read-string prompt))
  1549. X)))
  1550. X
  1551. X(defun ee-save-exit ()
  1552. X  "save file and exit"
  1553. X  (interactive)
  1554. X  (progn
  1555. X    (if (buffer-modified-p (get-buffer "EDIT"))
  1556. X    (message (concat "Saving " EE_FILE_NAME))
  1557. X      (message (concat EE_FILE_NAME " not modified")))
  1558. X    (sleep-for 1)      
  1559. X    (save-buffer)
  1560. X    (discard-input)
  1561. X    (kill-emacs)))
  1562. X
  1563. X(defun ee-save-noexit ()
  1564. X  "save file but do not exit"
  1565. X  (interactive)
  1566. X  (progn
  1567. X    (if (buffer-modified-p (get-buffer "EDIT"))
  1568. X    (message (concat "Saving " EE_FILE_NAME))
  1569. X      (message (concat EE_FILE_NAME " not modified")))
  1570. X    (sleep-for 1)      
  1571. X    (save-buffer)))
  1572. X
  1573. X(defun ee-saveto-file ()
  1574. X  "save file and exit"
  1575. X  (interactive)
  1576. X  (let ((default-directory "./"))
  1577. X    (progn
  1578. X      (set-buffer "EDIT")
  1579. X      
  1580. X      (setq sprompt "Save to what filename: ")
  1581. X      (setq savename (read-string sprompt))
  1582. X      (if (> (length savename) 0) 
  1583. X      (progn
  1584. X        (if (file-writable-p savename)
  1585. X        (progn
  1586. X          (setq SAVEFL
  1587. X            (if (file-exists-p savename)
  1588. X                (yes-or-no-p 
  1589. X                 (concat savename " exists!  Overwrite it? "))
  1590. X              t))
  1591. X          (if SAVEFL
  1592. X              (progn
  1593. X            (write-file savename)
  1594. X            (message 
  1595. X             (concat savename " saved;  " 
  1596. X                 EE_FILE_NAME " unchanged"))
  1597. X            (sleep-for 2)
  1598. X            (discard-input)
  1599. X            (kill-emacs))))
  1600. X          (message (concat "Cannot create/write to " savename))))))))
  1601. X
  1602. X
  1603. X(defun ee-grow-EDIT ()
  1604. X  "Enlarge EDIT window"
  1605. X  (interactive)
  1606. X  (cond 
  1607. X   ((window-point ee-HWIN) 
  1608. X    (progn
  1609. X      (enlarge-window 1)
  1610. X      (if (not (window-point ee-HWIN))
  1611. X      (setq HELP_HELP "To restore HELP window: ESC H"))
  1612. X    (ee-message HELP_HELP)))))
  1613. X
  1614. X(defun ee-next-subject ()
  1615. X  "Move to the next subject in the manual"
  1616. X  (interactive)
  1617. X  (if (window-point ee-HWIN)
  1618. X      (progn
  1619. X    (select-window ee-HWIN)
  1620. X    (forward-line)
  1621. X    (if (not (re-search-forward "^=" nil t))
  1622. X        (progn
  1623. X          (beginning-of-buffer)
  1624. X          (re-search-forward "^=" nil t)))
  1625. X    (recenter 1)
  1626. X    (ee-message HELP_HELP)
  1627. X    (select-window ee-EWIN))))
  1628. X(defun ee-previous-subject ()
  1629. X  "Move to the next subject in the manual"
  1630. X  (interactive)
  1631. X  (if (window-point ee-HWIN)
  1632. X      (progn
  1633. X    (select-window ee-HWIN)
  1634. X    (forward-line -1)
  1635. X    (if (not (re-search-backward "^=" nil t))
  1636. X        (progn
  1637. X          (end-of-buffer)
  1638. X          (re-search-backward "^=" nil t)))
  1639. X    (recenter 1)
  1640. X    (ee-message HELP_HELP)
  1641. X    (select-window ee-EWIN))))
  1642. X
  1643. X(defun ee-toggle-insert ()
  1644. X  "toggle insert/overwrite modes"
  1645. X  (interactive)
  1646. X  (cond 
  1647. X   ((= EASYEDIT-INSERT 1) 
  1648. X    (overwrite-mode 1)
  1649. X    (setq EASYEDIT-INSERT 0)
  1650. X    (setq EE_MODE "  *Overwrite*")
  1651. X    (ee-message HELP_HELP))
  1652. X   (t   (overwrite-mode 0)
  1653. X(setq EASYEDIT-INSERT 1)
  1654. X(setq EE_MODE "  *Insert*")
  1655. X(ee-message HELP_HELP))))
  1656. X
  1657. X;
  1658. X; elm easy editor setup
  1659. X
  1660. X(defun easyedit-mode ()
  1661. X  "set easyedit mode"
  1662. X  (if (eq major-mode 'easyedit-mode)
  1663. X      (message "already in easyedit-mode" (ding))
  1664. X    (setq mode-name "easy-edit")
  1665. X    (setq major-mode "easyedit-mode")
  1666. X    (use-local-map ee-com-map)
  1667. X    (put 'switch-to-buffer 'disabled t)
  1668. X    (put 'switch-to-buffer-other-window 'disabled t)
  1669. X    (put 'other-window 'disabled t)
  1670. X    (put 'kill-region 'disabled t)
  1671. X    (put 'execute-extended-command 'disabled t)
  1672. X    (setq HELP_HELP "ESC F / ESC B -> HELP forward / backward")
  1673. X    (setq window-min-height 1)
  1674. X    (setq fill-column 72)
  1675. X    (setq EASYEDIT-INSERT 1)
  1676. X    (setq EE_MODE "  *Insert*")
  1677. X    (setq search-last-string "")
  1678. X    (setq make-backup-files nil)
  1679. X    (setq require-final-newline t)
  1680. X    (auto-fill-mode 1)
  1681. X
  1682. X    (if (setq EE_RES_CMD (getenv "EE_RESUME_CMD"))
  1683. X    (setq EE_RESUME_MSG (concat "echo Suspending easy-edit.... to resume type " EE_RES_CMD))
  1684. X      (setq EE_RESUME_MSG (concat "echo Suspending easy-edit")))
  1685. X
  1686. X    (ee-message HELP_HELP)))
  1687. X    
  1688. X(if ee-com-map nil
  1689. X  (setq ee-com-map (make-keymap))
  1690. X
  1691. X  (define-key ee-com-map "\C-a" 'beginning-of-line)
  1692. X  (define-key ee-com-map "\C-b" 'backward-char)
  1693. X  (define-key ee-com-map "\C-c" 'abort-recursive-edit)
  1694. X  (define-key ee-com-map "\C-d" 'scroll-up)
  1695. X  (define-key ee-com-map "\C-e" 'end-of-line)
  1696. X  (define-key ee-com-map "\C-f" 'forward-char)
  1697. X  (define-key ee-com-map "\C-g" 'forward-word)
  1698. X  (define-key ee-com-map "\C-h" 'backward-delete-char-untabify)
  1699. X; i is the tab
  1700. X  (define-key ee-com-map "\C-j" 'next-line)
  1701. X  (define-key ee-com-map "\C-k" 'previous-line)
  1702. X  (define-key ee-com-map "\C-l" 'ee-not-here)
  1703. X; m is carriage return
  1704. X  (define-key ee-com-map "\C-n" 'next-line)
  1705. X  (define-key ee-com-map "\C-o" 'backward-word)
  1706. X  (define-key ee-com-map "\C-p" 'previous-line)
  1707. X  (define-key ee-com-map "\C-q" 'ee-search-backward)
  1708. X  (define-key ee-com-map "\C-r" 'redraw-display)
  1709. X  (define-key ee-com-map "\C-s" 'ee-search-forward)
  1710. X  (define-key ee-com-map "\C-t" 'ee-status)
  1711. X  (define-key ee-com-map "\C-u" 'scroll-down)
  1712. X  (define-key ee-com-map "\C-v" 'next-line)
  1713. X  (define-key ee-com-map "\C-w" 'kill-word)
  1714. X  (define-key ee-com-map "\C-x" 'delete-char)
  1715. X  (define-key ee-com-map "\C-y" 'yank)
  1716. X  (define-key ee-com-map "\C-z" 'ee-suspend-edit)
  1717. X; Make Sun and RT arrow keys work (at expense of back-paragraph (esc-[))
  1718. X  (defconst ee-esc-map (make-sparse-keymap)
  1719. X    " yea yea")
  1720. X  (define-key ee-com-map "\e" ee-esc-map)
  1721. X  (defconst esc-bracket-map (make-sparse-keymap)
  1722. X         "*Keymap for ESC-[ encoded keyboard")
  1723. X
  1724. X  (defconst esc-O-map (make-sparse-keymap)
  1725. X         "*Keymap for ESC-O encoded keyboard")
  1726. X  (define-key ee-esc-map "O" esc-O-map)
  1727. X
  1728. X  (define-key ee-esc-map "[" esc-bracket-map)   ; Install esc-bracket-map
  1729. X  (define-key ee-esc-map "[A" 'previous-line)   ; R8
  1730. X  (define-key ee-esc-map "[B" 'next-line)   ; R14
  1731. X  (define-key ee-esc-map "[C" 'forward-char)   ; R12
  1732. X  (define-key ee-esc-map "[D" 'backward-char)   ; R10
  1733. X  (define-key ee-esc-map "OA" 'previous-line)   ; R8
  1734. X (define-key ee-esc-map "OB" 'next-line)   ; R14
  1735. X (define-key ee-esc-map "OC" 'forward-char)   ; R12
  1736. X (define-key ee-esc-map "OD" 'backward-char)
  1737. X (define-key ee-esc-map "\e" 'abort-recursive-edit)
  1738. X
  1739. X  (define-key ee-com-map "\eA" 'beginning-of-buffer)
  1740. X  (define-key ee-com-map "\eb" 'ee-upp-help)
  1741. X  (define-key ee-com-map "\eB" 'ee-upl-help)
  1742. X  (define-key ee-com-map "\eC" 'ee-repeat-count)
  1743. X  (define-key ee-com-map "\eD" 'ee-nofun)
  1744. X  (define-key ee-com-map "\eE" 'end-of-buffer)
  1745. X  (define-key ee-com-map "\ef" 'ee-downp-help)
  1746. X  (define-key ee-com-map "\eF" 'ee-downl-help)
  1747. X  (define-key ee-com-map "\eG" 'goto-line)
  1748. X  (define-key ee-com-map "\eH" 'ee-restore-help)  
  1749. X  (define-key ee-com-map "\eI" 'ee-insert-file)  
  1750. X  (define-key ee-com-map "\eJ" 'ee-grow-EDIT)
  1751. X  (define-key ee-com-map "\eK" 'ee-kill-to-eof)
  1752. X  (define-key ee-com-map "\eL" 'ee-kill-line)  
  1753. X  (define-key ee-com-map "\eM" 'ee-manual)
  1754. X  (define-key ee-com-map "\eN" 'ee-toggle-insert)
  1755. X; ESC O used for cursor motion map
  1756. X  (define-key ee-com-map "\eP" 'fill-paragraph)  
  1757. X  (define-key ee-com-map "\eQ" 'ee-quit)
  1758. X  (define-key ee-com-map "\eR" 'ee-recover)
  1759. X  (define-key ee-com-map "\eS" 'ee-save-exit)
  1760. X  (define-key ee-com-map "\eT" 'ee-saveto-file)
  1761. X  (define-key ee-com-map "\eU" 'undo)
  1762. X  (define-key ee-com-map "\eV" 'ee-switch-help)
  1763. X  (define-key ee-com-map "\eW" 'ee-save-noexit)
  1764. X  (define-key ee-com-map "\eX" 'kill-line)
  1765. X  (define-key ee-com-map "\eY" 'ee-search-replace)
  1766. X  (define-key ee-com-map "\eZ" 'ee-zap-help)
  1767. X  (define-key ee-com-map "\ea" 'beginning-of-buffer)
  1768. X  (define-key ee-com-map "\ec" 'ee-repeat-count)
  1769. X  (define-key ee-com-map "\ed" 'ee-list-dir)
  1770. X  (define-key ee-com-map "\ee" 'end-of-buffer)
  1771. X  (define-key ee-com-map "\eg" 'goto-line)
  1772. X  (define-key ee-com-map "\eh" 'ee-restore-help)  
  1773. X  (define-key ee-com-map "\ei" 'ee-insert-file)  
  1774. X  (define-key ee-com-map "\ej" 'ee-grow-EDIT)
  1775. X  (define-key ee-com-map "\ek" 'ee-kill-to-eof)
  1776. X  (define-key ee-com-map "\el" 'ee-kill-line)  
  1777. X  (define-key ee-com-map "\em" 'ee-manual)
  1778. X  (define-key ee-com-map "\en" 'ee-toggle-insert)
  1779. X; ESC O used for cursor motion map
  1780. X  (define-key ee-com-map "\eo" 'ee-nofun)
  1781. X  (define-key ee-com-map "\ep" 'fill-paragraph)  
  1782. X  (define-key ee-com-map "\eq" 'ee-quit)
  1783. X  (define-key ee-com-map "\er" 'ee-recover)
  1784. X  (define-key ee-com-map "\es" 'ee-save-exit)
  1785. X  (define-key ee-com-map "\et" 'ee-saveto-file)
  1786. X  (define-key ee-com-map "\eu" 'undo)
  1787. X  (define-key ee-com-map "\ev" 'ee-switch-help)
  1788. X  (define-key ee-com-map "\ew" 'ee-save-noexit)
  1789. X  (define-key ee-com-map "\ex" 'kill-line)
  1790. X  (define-key ee-com-map "\ey" 'ee-search-replace)
  1791. X  (define-key ee-com-map "\ez" 'ee-zap-help)
  1792. X
  1793. X  (define-key ee-com-map "\e!" 'ee-unix-command)
  1794. X  (define-key ee-com-map "\e>" 'ee-not-manual)
  1795. X  (define-key ee-com-map "\e<" 'ee-not-manual)
  1796. X  (define-key ee-com-map "\e@" 'ee-license)
  1797. X  (define-key ee-com-map "\e#" 'ee-nofun)
  1798. X  (define-key ee-com-map "\e$" 'ee-nofun)
  1799. X  (define-key ee-com-map "\e%" 'ee-nofun)
  1800. X  (define-key ee-com-map "\e^" 'ee-nofun)
  1801. X  (define-key ee-com-map "\e&" 'ee-nofun)
  1802. X  (define-key ee-com-map "\e*" 'ee-nofun)
  1803. X  (define-key ee-com-map "\e(" 'ee-nofun)
  1804. X  (define-key ee-com-map "\e)" 'ee-nofun)
  1805. X  (define-key ee-com-map "\e_" 'ee-nofun)
  1806. X  (define-key ee-com-map "\e+" 'ee-insert-block)
  1807. X  (define-key ee-com-map "\e-" 'ee-nofun)
  1808. X  (define-key ee-com-map "\e=" 'ee-nofun)
  1809. X  (define-key ee-com-map "\e{" 'ee-nofun)
  1810. X  (define-key ee-com-map "\e}" 'ee-nofun)
  1811. X  (define-key ee-com-map "\e]" 'ee-nofun)
  1812. X  (define-key ee-com-map "\e:" 'ee-nofun)
  1813. X  (define-key ee-com-map "\e;" 'ee-nofun)
  1814. X  (define-key ee-com-map "\e\"" 'ee-nofun)
  1815. X  (define-key ee-com-map "\e~" 'ee-nofun)
  1816. X  (define-key ee-com-map "\e'" 'ee-nofun)
  1817. X  (define-key ee-com-map "\e`" 'ee-nofun)
  1818. X  (define-key ee-com-map "\e\." 'ee-nofun)
  1819. X  (define-key ee-com-map "\e\," 'ee-nofun)
  1820. X  (define-key ee-com-map "\e?" 'ee-nofun)
  1821. X  (define-key ee-com-map "\e/" 'ee-move-block)
  1822. X  (define-key ee-com-map "\e|" 'ee-nofun)
  1823. X  (define-key ee-com-map "\e\\" 'ee-nofun)
  1824. X
  1825. X;
  1826. X;  DISABLE (or set) all esc/control sequecnes for minibuffer and regular editing
  1827. X;
  1828. X
  1829. X  (define-key ee-com-map "\e\C-a" 'ee-nofun)
  1830. X  (define-key ee-com-map "\e\C-b" 'ee-nofun)
  1831. X  (define-key ee-com-map "\e\C-c" 'ee-nofun)
  1832. X  (define-key ee-com-map "\e\C-d" 'ee-nofun)
  1833. X  (define-key ee-com-map "\e\C-e" 'ee-nofun)
  1834. X  (define-key ee-com-map "\e\C-f" 'ee-nofun)
  1835. X  (define-key ee-com-map "\e\C-g" 'ee-nofun)
  1836. X  (define-key ee-com-map "\e\C-h" 'ee-nofun)
  1837. X  (define-key ee-com-map "\e\C-i" 'ee-nofun)
  1838. X  (define-key ee-com-map "\e\C-j" 'ee-nofun)
  1839. X  (define-key ee-com-map "\e\C-k" 'ee-nofun)
  1840. X  (define-key ee-com-map "\e\C-l" 'ee-nofun)
  1841. X  (define-key ee-com-map "\e\C-m" 'ee-nofun)
  1842. X  (define-key ee-com-map "\e\C-n" 'ee-nofun)
  1843. X  (define-key ee-com-map "\e\C-o" 'ee-nofun)
  1844. X  (define-key ee-com-map "\e\C-p" 'ee-nofun)
  1845. X  (define-key ee-com-map "\e\C-q" 'ee-nofun)
  1846. X  (define-key ee-com-map "\e\C-r" 'ee-nofun)
  1847. X  (define-key ee-com-map "\e\C-s" 'ee-nofun)
  1848. X  (define-key ee-com-map "\e\C-t" 'ee-nofun)
  1849. X  (define-key ee-com-map "\e\C-u" 'ee-nofun)
  1850. X  (define-key ee-com-map "\e\C-v" 'ee-nofun)
  1851. X  (define-key ee-com-map "\e\C-w" 'ee-nofun)
  1852. X  (define-key ee-com-map "\e\C-x" 'ee-nofun)
  1853. X  (define-key ee-com-map "\e\C-y" 'ee-nofun)
  1854. X  (define-key ee-com-map "\e\C-z" 'ee-nofun)
  1855. X  (define-key ee-com-map "\e\C-!" 'ee-nofun)
  1856. X  (define-key ee-com-map "\e\C->" 'ee-nofun)
  1857. X  (define-key ee-com-map "\e\C-<" 'ee-nofun)
  1858. X  (define-key ee-com-map "\e\C-@" 'ee-nofun)
  1859. X  (define-key ee-com-map "\e\C-#" 'ee-nofun)
  1860. X  (define-key ee-com-map "\e\C-$" 'ee-nofun)
  1861. X  (define-key ee-com-map "\e\C-%" 'ee-nofun)
  1862. X  (define-key ee-com-map "\e\C-^" 'ee-nofun)
  1863. X  (define-key ee-com-map "\e\C-&" 'ee-nofun)
  1864. X  (define-key ee-com-map "\e\C-*" 'ee-nofun)
  1865. X  (define-key ee-com-map "\e\C-(" 'ee-nofun)
  1866. X  (define-key ee-com-map "\e\C-)" 'ee-nofun)
  1867. X  (define-key ee-com-map "\e\C-_" 'ee-nofun)
  1868. X  (define-key ee-com-map "\e\C-+" 'ee-nofun)
  1869. X  (define-key ee-com-map "\e\C--" 'ee-nofun)
  1870. X  (define-key ee-com-map "\e\C-=" 'ee-nofun)
  1871. X  (define-key ee-com-map "\e\C-{" 'ee-nofun)
  1872. X  (define-key ee-com-map "\e\C-}" 'ee-nofun)
  1873. X  (define-key ee-com-map "\e\C-]" 'ee-nofun)
  1874. X  (define-key ee-com-map "\e\C-:" 'ee-nofun)
  1875. X  (define-key ee-com-map "\e\C-;" 'ee-nofun)
  1876. X  (define-key ee-com-map "\e\C-\"" 'ee-nofun)
  1877. X  (define-key ee-com-map "\e\C-~" 'ee-nofun)
  1878. X  (define-key ee-com-map "\e\C-'" 'ee-nofun)
  1879. X  (define-key ee-com-map "\e\C-`" 'ee-nofun)
  1880. X  (define-key ee-com-map "\e\C-\." 'ee-nofun)
  1881. X  (define-key ee-com-map "\e\C-\," 'ee-nofun)
  1882. X  (define-key ee-com-map "\e\C-?" 'ee-nofun)
  1883. X  (define-key ee-com-map "\e\C-/" 'ee-nofun)
  1884. X  (define-key ee-com-map "\e\C-|" 'ee-nofun)
  1885. X  (define-key ee-com-map "\e\C-\\" 'ee-nofun)
  1886. X
  1887. X  (define-key minibuffer-local-map "\e\C-a" 'ee-nofun)
  1888. X  (define-key minibuffer-local-map "\e\C-b" 'ee-nofun)
  1889. X  (define-key minibuffer-local-map "\e\C-c" 'ee-nofun)
  1890. X  (define-key minibuffer-local-map "\e\C-d" 'ee-nofun)
  1891. X  (define-key minibuffer-local-map "\e\C-e" 'ee-nofun)
  1892. X  (define-key minibuffer-local-map "\e\C-f" 'ee-nofun)
  1893. X  (define-key minibuffer-local-map "\e\C-g" 'ee-nofun)
  1894. X  (define-key minibuffer-local-map "\e\C-h" 'ee-nofun)
  1895. X  (define-key minibuffer-local-map "\e\C-i" 'ee-nofun)
  1896. X  (define-key minibuffer-local-map "\e\C-j" 'ee-nofun)
  1897. X  (define-key minibuffer-local-map "\e\C-k" 'ee-nofun)
  1898. X  (define-key minibuffer-local-map "\e\C-l" 'ee-nofun)
  1899. X  (define-key minibuffer-local-map "\e\C-m" 'ee-nofun)
  1900. X  (define-key minibuffer-local-map "\e\C-n" 'ee-nofun)
  1901. X  (define-key minibuffer-local-map "\e\C-o" 'ee-nofun)
  1902. X  (define-key minibuffer-local-map "\e\C-p" 'ee-nofun)
  1903. X  (define-key minibuffer-local-map "\e\C-q" 'ee-nofun)
  1904. X  (define-key minibuffer-local-map "\e\C-r" 'ee-nofun)
  1905. X  (define-key minibuffer-local-map "\e\C-s" 'ee-nofun)
  1906. X  (define-key minibuffer-local-map "\e\C-t" 'ee-nofun)
  1907. X  (define-key minibuffer-local-map "\e\C-u" 'ee-nofun)
  1908. X  (define-key minibuffer-local-map "\e\C-v" 'ee-nofun)
  1909. X  (define-key minibuffer-local-map "\e\C-w" 'ee-nofun)
  1910. X  (define-key minibuffer-local-map "\e\C-x" 'ee-nofun)
  1911. X  (define-key minibuffer-local-map "\e\C-y" 'ee-nofun)
  1912. X  (define-key minibuffer-local-map "\e\C-z" 'ee-nofun)
  1913. X  (define-key minibuffer-local-map "\e\C-!" 'ee-nofun)
  1914. X  (define-key minibuffer-local-map "\e\C->" 'ee-nofun)
  1915. X  (define-key minibuffer-local-map "\e\C-<" 'ee-nofun)
  1916. X  (define-key minibuffer-local-map "\e\C-@" 'ee-nofun)
  1917. X  (define-key minibuffer-local-map "\e\C-#" 'ee-nofun)
  1918. X  (define-key minibuffer-local-map "\e\C-$" 'ee-nofun)
  1919. X  (define-key minibuffer-local-map "\e\C-%" 'ee-nofun)
  1920. X  (define-key minibuffer-local-map "\e\C-^" 'ee-nofun)
  1921. X  (define-key minibuffer-local-map "\e\C-&" 'ee-nofun)
  1922. X  (define-key minibuffer-local-map "\e\C-*" 'ee-nofun)
  1923. X  (define-key minibuffer-local-map "\e\C-(" 'ee-nofun)
  1924. X  (define-key minibuffer-local-map "\e\C-)" 'ee-nofun)
  1925. X  (define-key minibuffer-local-map "\e\C-_" 'ee-nofun)
  1926. X  (define-key minibuffer-local-map "\e\C-+" 'ee-nofun)
  1927. X  (define-key minibuffer-local-map "\e\C--" 'ee-nofun)
  1928. X  (define-key minibuffer-local-map "\e\C-=" 'ee-nofun)
  1929. X  (define-key minibuffer-local-map "\e\C-{" 'ee-nofun)
  1930. X  (define-key minibuffer-local-map "\e\C-}" 'ee-nofun)
  1931. X  (define-key minibuffer-local-map "\e\C-]" 'ee-nofun)
  1932. X  (define-key minibuffer-local-map "\e\C-:" 'ee-nofun)
  1933. X  (define-key minibuffer-local-map "\e\C-;" 'ee-nofun)
  1934. X  (define-key minibuffer-local-map "\e\C-\"" 'ee-nofun)
  1935. X  (define-key minibuffer-local-map "\e\C-~" 'ee-nofun)
  1936. X  (define-key minibuffer-local-map "\e\C-'" 'ee-nofun)
  1937. X  (define-key minibuffer-local-map "\e\C-`" 'ee-nofun)
  1938. X  (define-key minibuffer-local-map "\e\C-\." 'ee-nofun)
  1939. X  (define-key minibuffer-local-map "\e\C-\," 'ee-nofun)
  1940. X  (define-key minibuffer-local-map "\e\C-?" 'ee-nofun)
  1941. X  (define-key minibuffer-local-map "\e\C-/" 'ee-nofun)
  1942. X  (define-key minibuffer-local-map "\e\C-|" 'ee-nofun)
  1943. X  (define-key minibuffer-local-map "\e\C-\\" 'ee-nofun)
  1944. X
  1945. X
  1946. X; various escape sequecnes for arrow keys in minibuffer
  1947. X; Make Sun and RT arrow keys work 
  1948. X  (defconst esc-bracket-map (make-sparse-keymap)
  1949. X    "*Keymap for ESC-[ encoded keyboard")
  1950. X  (progn
  1951. X    (define-key esc-map "[" esc-bracket-map)   ; Install esc-bracket-map
  1952. X    (define-key esc-map "[A" 'previous-line)   ; R8
  1953. X    (define-key esc-map "[B" 'next-line)   ; R14
  1954. X    (define-key esc-map "[C" 'forward-char)   ; R12
  1955. X    (define-key esc-map "[D" 'backward-char)   ; R10
  1956. X    (define-key esc-map "[[" 'backward-paragraph))   ; the original esc-[
  1957. X  
  1958. X  (defconst esc-O-map (make-sparse-keymap)
  1959. X    "*Keymap for ESC-[ encoded keyboard")
  1960. X  (progn
  1961. X    (define-key esc-map "O" esc-O-map)   ; Install esc-O-map
  1962. X    (define-key esc-map "OA" 'previous-line)   ; R8
  1963. X    (define-key esc-map "OB" 'next-line)   ; R14
  1964. X    (define-key esc-map "OC" 'forward-char)   ; R12
  1965. X    (define-key esc-map "OD" 'backward-char))   ; R10
  1966. X
  1967. X  (define-key minibuffer-local-map "\C-a" 'beginning-of-line)
  1968. X  (define-key minibuffer-local-map "\C-b" 'backward-char)
  1969. X  (define-key minibuffer-local-map "\C-c" 'abort-recursive-edit)
  1970. X  (define-key minibuffer-local-map "\C-d" 'ee-not-here)
  1971. X  (define-key minibuffer-local-map "\C-e" 'end-of-line)
  1972. X  (define-key minibuffer-local-map "\C-f" 'forward-char)
  1973. X  (define-key minibuffer-local-map "\C-g" 'forward-word)
  1974. X  (define-key minibuffer-local-map "\C-h" 'backward-delete-char-untabify)
  1975. X; i is the tab
  1976. X  (define-key minibuffer-local-map "\C-j" 'ee-not-here)
  1977. X  (define-key minibuffer-local-map "\C-k" 'ee-not-here)
  1978. X  (define-key minibuffer-local-map "\C-l" 'ee-not-here)
  1979. X; m is carriage return
  1980. X  (define-key minibuffer-local-map "\C-n" 'ee-not-here)
  1981. X  (define-key minibuffer-local-map "\C-o" 'backward-word)
  1982. X  (define-key minibuffer-local-map "\C-p" 'ee-not-here)
  1983. X  (define-key minibuffer-local-map "\C-q" 'ee-not-here)
  1984. X  (define-key minibuffer-local-map "\C-r" 'redraw-display)
  1985. X  (define-key minibuffer-local-map "\C-s" 'ee-not-here)
  1986. X  (define-key minibuffer-local-map "\C-t" 'ee-not-here)
  1987. X  (define-key minibuffer-local-map "\C-u" 'ee-not-here)
  1988. X  (define-key minibuffer-local-map "\C-v" 'ee-not-here)
  1989. X  (define-key minibuffer-local-map "\C-w" 'kill-word)
  1990. X  (define-key minibuffer-local-map "\C-x" 'delete-char)
  1991. X  (define-key minibuffer-local-map "\C-y" 'yank)
  1992. X  (define-key minibuffer-local-map "\C-z" 'ee-suspend-edit)
  1993. X  (define-key minibuffer-local-map "\eA" 'ee-not-here)
  1994. X  (define-key minibuffer-local-map "\eB" 'ee-not-here)
  1995. X  (define-key minibuffer-local-map "\eC" 'ee-not-here)
  1996. X  (define-key minibuffer-local-map "\eD" 'ee-list-dir)
  1997. X  (define-key minibuffer-local-map "\eE" 'ee-not-here)
  1998. X  (define-key minibuffer-local-map "\eF" 'ee-not-here)
  1999. X  (define-key minibuffer-local-map "\eG" 'ee-not-here)
  2000. X  (define-key minibuffer-local-map "\eH" 'ee-not-here)
  2001. X  (define-key minibuffer-local-map "\eI" 'ee-not-here)
  2002. X  (define-key minibuffer-local-map "\eJ" 'ee-not-here)
  2003. X  (define-key minibuffer-local-map "\eK" 'ee-not-here)
  2004. X  (define-key minibuffer-local-map "\eL" 'ee-kill-line)  
  2005. X  (define-key minibuffer-local-map "\eM" 'ee-not-here)
  2006. X  (define-key minibuffer-local-map "\eN" 'ee-toggle-insert)
  2007. X  (define-key minibuffer-local-map "\eP" 'ee-not-here)
  2008. X  (define-key minibuffer-local-map "\eQ" 'ee-not-here)
  2009. X  (define-key minibuffer-local-map "\eR" 'ee-not-here)
  2010. X  (define-key minibuffer-local-map "\eS" 'ee-not-here)
  2011. X  (define-key minibuffer-local-map "\eT" 'ee-not-here)
  2012. X  (define-key minibuffer-local-map "\eU" 'undo)
  2013. X  (define-key minibuffer-local-map "\eV" 'ee-not-here)
  2014. X  (define-key minibuffer-local-map "\eW" 'ee-not-here)
  2015. X  (define-key minibuffer-local-map "\eX" 'kill-line)
  2016. X  (define-key minibuffer-local-map "\eY" 'ee-not-here)
  2017. X  (define-key minibuffer-local-map "\eZ" 'ee-not-here)
  2018. X  (define-key minibuffer-local-map "\ea" 'ee-not-here)
  2019. X  (define-key minibuffer-local-map "\eb" 'ee-not-here)
  2020. X  (define-key minibuffer-local-map "\ec" 'ee-not-here)
  2021. X  (define-key minibuffer-local-map "\ed" 'ee-not-here)
  2022. X  (define-key minibuffer-local-map "\ee" 'ee-not-here)
  2023. X  (define-key minibuffer-local-map "\ef" 'ee-not-here)
  2024. X  (define-key minibuffer-local-map "\eg" 'ee-not-here)
  2025. X  (define-key minibuffer-local-map "\eh" 'ee-not-here)
  2026. X  (define-key minibuffer-local-map "\ei" 'ee-not-here)
  2027. X  (define-key minibuffer-local-map "\ej" 'ee-not-here)
  2028. X  (define-key minibuffer-local-map "\ek" 'ee-not-here)
  2029. X  (define-key minibuffer-local-map "\el" 'ee-kill-line)  
  2030. X  (define-key minibuffer-local-map "\em" 'ee-not-here)
  2031. X  (define-key minibuffer-local-map "\en" 'ee-toggle-insert)
  2032. X  (define-key minibuffer-local-map "\ep" 'ee-not-here)
  2033. X  (define-key minibuffer-local-map "\eq" 'ee-not-here)
  2034. X  (define-key minibuffer-local-map "\er" 'ee-not-here)
  2035. X  (define-key minibuffer-local-map "\es" 'ee-not-here)
  2036. X  (define-key minibuffer-local-map "\et" 'ee-not-here)
  2037. X  (define-key minibuffer-local-map "\eu" 'undo)
  2038. X  (define-key minibuffer-local-map "\ev" 'ee-not-here)
  2039. X  (define-key minibuffer-local-map "\ew" 'ee-not-here)
  2040. X  (define-key minibuffer-local-map "\ex" 'kill-line)
  2041. X  (define-key minibuffer-local-map "\ey" 'ee-not-here)
  2042. X  (define-key minibuffer-local-map "\ez" 'ee-not-here)
  2043. X  
  2044. X  (define-key minibuffer-local-map "\e!" 'ee-nofun)
  2045. X  (define-key minibuffer-local-map "\e@" 'ee-nofun)
  2046. X  (define-key minibuffer-local-map "\e#" 'ee-nofun)
  2047. X  (define-key minibuffer-local-map "\e$" 'ee-nofun)
  2048. X  (define-key minibuffer-local-map "\e%" 'ee-nofun)
  2049. X  (define-key minibuffer-local-map "\e^" 'ee-nofun)
  2050. X  (define-key minibuffer-local-map "\e&" 'ee-nofun)
  2051. X  (define-key minibuffer-local-map "\e*" 'ee-nofun)
  2052. X  (define-key minibuffer-local-map "\e(" 'ee-nofun)
  2053. X  (define-key minibuffer-local-map "\e)" 'ee-nofun)
  2054. X  (define-key minibuffer-local-map "\e_" 'ee-nofun)
  2055. X  (define-key minibuffer-local-map "\e+" 'ee-nofun)
  2056. X  (define-key minibuffer-local-map "\e-" 'ee-nofun)
  2057. X  (define-key minibuffer-local-map "\e=" 'ee-nofun)
  2058. X  (define-key minibuffer-local-map "\e{" 'ee-nofun)
  2059. X  (define-key minibuffer-local-map "\e}" 'ee-nofun)
  2060. X  (define-key minibuffer-local-map "\e]" 'ee-nofun)
  2061. X  (define-key minibuffer-local-map "\e:" 'ee-nofun)
  2062. X  (define-key minibuffer-local-map "\e;" 'ee-nofun)
  2063. X  (define-key minibuffer-local-map "\e\"" 'ee-nofun)
  2064. X  (define-key minibuffer-local-map "\e~" 'ee-nofun)
  2065. X  (define-key minibuffer-local-map "\e'" 'ee-nofun)
  2066. X  (define-key minibuffer-local-map "\e`" 'ee-nofun)
  2067. X  (define-key minibuffer-local-map "\e\." 'ee-nofun)
  2068. X  (define-key minibuffer-local-map "\e\," 'ee-nofun)
  2069. X  (define-key minibuffer-local-map "\e?" 'ee-nofun)
  2070. X  (define-key minibuffer-local-map "\e/" 'ee-nofun)
  2071. X  (define-key minibuffer-local-map "\e|" 'ee-nofun)
  2072. X  (define-key minibuffer-local-map "\e\\" 'ee-nofun)
  2073. X)
  2074. X
  2075. X
  2076. X
  2077. X(defun ee-list-dir ()
  2078. X  "List a directory in another window"
  2079. X  (interactive)
  2080. X  (let ((default-directory "./"))
  2081. X    (setq gamsg "\n\n\nType a filename, a directory name, or a wildcard 
  2082. X(e.g. t*   lists all files starting with t)
  2083. Xto list particular files or an entire directory.\n
  2084. XType a carriage return alone to list the current working directory")
  2085. X(setq ldir (ee-get-arg gamsg "Dir or file(s) to list: ")) 
  2086. X(save-window-excursion
  2087. X  (if (eq 0 (length ldir))
  2088. X      (setq ldir "."))
  2089. X  
  2090. X  (setq lcomm (concat "ls -l " ldir))
  2091. X  (setq command (concat "(set noglob; /bin/echo command executed: " lcomm ");" lcomm))
  2092. X  (with-output-to-temp-buffer "*Directory*"
  2093. X    (buffer-flush-undo standard-output)
  2094. X    (message "Working...")
  2095. X    (call-process "csh" nil standard-output nil "-c" command))
  2096. X  (let ((cursor-in-echo-area t))
  2097. X    (setq char ?b)
  2098. X    (while (not (eq char ?r))
  2099. X      (progn 
  2100. X    (message "(f)orward  (b)ackwards  (r)esume editing: ")
  2101. X    (setq char (downcase (read-char)))
  2102. X    (other-window 1)
  2103. X    (cond ((eq char ?f) 
  2104. X           (if (not (pos-visible-in-window-p (point-max))) 
  2105. X           (scroll-up)(ding)(message "At bottom")(sleep-for 2)))
  2106. X          ((eq char ?b) 
  2107. X           (if (not (pos-visible-in-window-p (point-min))) 
  2108. X           (scroll-down)(ding)(message "At top")(sleep-for 2)))
  2109. X          ((eq char ?r) nil)
  2110. X          (t   (message "Type f, b, or r please: ")
  2111. X           (sleep-for 2)
  2112. X           t))
  2113. X    (other-window 1))) )))
  2114. X)
  2115. X
  2116. X(defun ee-license ()
  2117. X  "License info"
  2118. X  (interactive)
  2119. X(save-window-excursion
  2120. X
  2121. X  (with-output-to-temp-buffer "*LICENSE*"
  2122. X
  2123. X    (buffer-flush-undo standard-output)
  2124. X    (princ " Easy-edit novice screen editor for Unix systems with GNU emacs\n")
  2125. X    (princ "
  2126. X     Easy-edit " ) (princ ee-VERSION)
  2127. X    (princ "
  2128. X
  2129. X     Copyright (C) 1992     Larry Broda
  2130. X                            Department of Psychology
  2131. X                            University of Illinois at Urbana-Champaign
  2132. X
  2133. X    This program is distributed in the hope that it will be useful, 
  2134. X    but WITHOUT ANY WARRANTY; without even the implied warranty of 
  2135. X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  This program  
  2136. X    is an extension of GNU emacs; See the GNU General Public License  
  2137. X    for more details. 
  2138. X
  2139. X    This program is free software; you can redistribute it and/or modify
  2140. X    it under the same terms as the GNU General Public License as published by
  2141. X    the Free Software Foundation; either version 1, or (at your option)
  2142. X    any later version.
  2143. X
  2144. X
  2145. X       By Larry Broda  
  2146. X       Department of Psychology
  2147. X       University of Illinois at Urbana-Champaign
  2148. X       Email: lbroda@s.psych.uiuc.edu
  2149. X       4/13/92 
  2150. X
  2151. X    for GNU emacs information contact:
  2152. X    Free Software Foundation
  2153. X    675 Massachusetts Avenu
  2154. X    Cambridge, MA 02139
  2155. X    USA
  2156. X"))
  2157. X  (let ((cursor-in-echo-area t))
  2158. X    (setq char ?b)
  2159. X    (while (not (eq char ?r))
  2160. X      (progn 
  2161. X    (message "(f)orward  (b)ackwards  (r)esume editing: ")
  2162. X    (setq char (downcase (read-char)))
  2163. X    (other-window 1)
  2164. X    (cond ((eq char ?f) 
  2165. X           (if (not (pos-visible-in-window-p (point-max))) 
  2166. X           (scroll-up)(ding)(message "At bottom")(sleep-for 2)))
  2167. X          ((eq char ?b) 
  2168. X           (if (not (pos-visible-in-window-p (point-min))) 
  2169. X           (scroll-down)(ding)(message "At top")(sleep-for 2)))
  2170. X          ((eq char ?r) nil)
  2171. X          (t   (message "Type f, b, or r please: ")
  2172. X           (sleep-for 2)
  2173. X           t))
  2174. X    (other-window 1)))))
  2175. X)
  2176. X
  2177. X(defun ee-repeat-count ()
  2178. X  "Begin a numeric argument for the following command.
  2179. XDigits or minus sign following this command make up the numeric argument.
  2180. XIf no digits or minus sign follow, this command by itself provides 4 as argument.
  2181. XUsed more than once, this command multiplies the argument by 4 each time."
  2182. X  (interactive nil)
  2183. X  (message "Enter count followed by key or command to repeat: ")
  2184. X  (let ((c-u 4) (argstartchar last-command-char)
  2185. X    char)
  2186. X    (setq char (read-char))
  2187. X    (while (= char argstartchar)
  2188. X      (setq c-u (* 4 c-u))
  2189. X      (setq char (read-char)))
  2190. X    (prefix-arg-internal char c-u nil)))
  2191. X
  2192. X(defun ee-not-manual ()
  2193. X  "Error for using manual commands outside manual"
  2194. X  (interactive)
  2195. X  (message "This command only valid if manual is displayed")
  2196. X  (ding)
  2197. X  (sleep-for 3)
  2198. X  (ee-message HELP_HELP))
  2199. X
  2200. X(defun ee-unix-command ()
  2201. X  "execute a Unix command"
  2202. X  (interactive)
  2203. X  (setq gamsg "Type a unix command.  The output will be displayed in
  2204. Xa special window, where you may:
  2205. X1: Scroll the output listing forward and backward (f/b).
  2206. X2: Insert the command output listing into your edit file at the current 
  2207. X   cursor location (i).
  2208. XNOTE:  The command can *NOT* be a command that requires further input by you;
  2209. XUse ^Z to escape to a Unix prompt to perform interactive commands.
  2210. XEXAMPLES of valid commands: date; cat <filename>; who, etc.
  2211. XEXAMPLES of *INVALID* commands: Elm; easyedit; Mail, etc.
  2212. X...or anything that requires additional input from you..")
  2213. X  (let ((default-directory "./"))
  2214. X    (setq command (ee-get-arg gamsg "Unix Command: ")) 
  2215. X    (save-window-excursion
  2216. X      (with-output-to-temp-buffer "*Unix*"
  2217. X    (buffer-flush-undo standard-output)
  2218. X    (message (concat "executing " (concat command "...")))
  2219. X    (call-process "csh" nil standard-output nil "-c" command))
  2220. X      (let ((cursor-in-echo-area t))
  2221. X    (setq char ?b)
  2222. X    (while (not (eq char ?r))
  2223. X      (progn 
  2224. X        (message "(f)orward  (b)ackwards  (i)nsert output into file  (r)esume editing: ")
  2225. X        (setq char (downcase (read-char)))
  2226. X        (other-window 1)
  2227. X        (cond ((eq char ?f) 
  2228. X           (if (not (pos-visible-in-window-p (point-max))) 
  2229. X               (scroll-up)(ding)(message "At bottom")(sleep-for 2)))
  2230. X          ((eq char ?b) 
  2231. X           (if (not (pos-visible-in-window-p (point-min))) 
  2232. X               (scroll-down)(ding)(message "At top")(sleep-for 2)))
  2233. X          ((eq char ?r) nil)
  2234. X          ((eq char ?i) (progn (copy-to-register ?v (point-min)(point-max) nil)
  2235. X                       (other-window 1)
  2236. X                       (insert-register ?v)
  2237. X                       (other-window 1)))
  2238. X          
  2239. X          (t   (message "Type f, b, i, or r please: ")
  2240. X               (sleep-for 2)
  2241. X               t))
  2242. X        (other-window 1))))))
  2243. X  )
  2244. X
  2245. X
  2246. X;
  2247. X;
  2248. X;  create the separate windows
  2249. X;
  2250. X
  2251. X(progn
  2252. X  (setq EE_FILE_NAME (file-name-nondirectory buffer-file-name))
  2253. X  (ee-check-recovery-file EE_FILE_NAME)
  2254. X  (rename-buffer "EDIT")
  2255. X  (setq ee-EWIN (selected-window))
  2256. X  (setq ee-BLOCK-MARK 0)
  2257. X  (setq ee-BLOCK-SAVED nil)
  2258. X  (ee-create-help)
  2259. X  (easyedit-mode)
  2260. X  (if (getenv "EE_HELP_OFF")
  2261. X        (progn (ee-zap-help) ))
  2262. X)
  2263. END_OF_FILE
  2264. if test 45297 -ne `wc -c <'easyedit.el'`; then
  2265.     echo shar: \"'easyedit.el'\" unpacked with wrong size!
  2266. fi
  2267. # end of 'easyedit.el'
  2268. fi
  2269. if test -f 'ee.license' -a "${1}" != "-c" ; then 
  2270.   echo shar: Will not clobber existing file \"'ee.license'\"
  2271. else
  2272. echo shar: Extracting \"'ee.license'\" \(1026 characters\)
  2273. sed "s/^X//" >'ee.license' <<'END_OF_FILE'
  2274. X
  2275. X     Easy-edit 1.23
  2276. X
  2277. X     Copyright (C) 1992     Larry Broda
  2278. X                            Department of Psychology
  2279. X                            University of Illinois at Urbana-Champaign
  2280. X
  2281. X    This program is distributed in the hope that it will be useful, 
  2282. X    but WITHOUT ANY WARRANTY; without even the implied warranty of 
  2283. X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  This program  
  2284. X    is an extension of GNU emacs; See the GNU General Public License  
  2285. X    for more details. 
  2286. X
  2287. X    This program is free software; you can redistribute it and/or modify
  2288. X    it under the same terms as the GNU General Public License as published by
  2289. X    the Free Software Foundation either version 1, or (at your option)
  2290. X    any later version.
  2291. X
  2292. X       By Larry Broda  
  2293. X       Department of Psychology
  2294. X       University of Illinois at Urbana-Champaign
  2295. X       Email: lbroda@s.psych.uiuc.edu
  2296. X       7/2/92 
  2297. X
  2298. X    for GNU emacs information contact:
  2299. X    Free Software Foundation
  2300. X    675 Massachusetts Avenu
  2301. X    Cambridge, MA 02139
  2302. X    USA
  2303. END_OF_FILE
  2304. if test 1026 -ne `wc -c <'ee.license'`; then
  2305.     echo shar: \"'ee.license'\" unpacked with wrong size!
  2306. fi
  2307. # end of 'ee.license'
  2308. fi
  2309. if test -f 'ee.sh.template' -a "${1}" != "-c" ; then 
  2310.   echo shar: Will not clobber existing file \"'ee.sh.template'\"
  2311. else
  2312. echo shar: Extracting \"'ee.sh.template'\" \(2241 characters\)
  2313. sed "s/^X//" >'ee.sh.template' <<'END_OF_FILE'
  2314. X#
  2315. X#    Run emacs in the "easy edit" mode
  2316. X#
  2317. X# 
  2318. X#Easy-edit novice screen editor for Unix systems with GNU emacs
  2319. X# 
  2320. X# Copyright (C) 1992     Larry Broda
  2321. X# 
  2322. X#    This program is free software; you can redistribute it and/or modify
  2323. X#    it under the terms of the GNU General Public License as published by
  2324. X#    the Free Software Foundation; either version 1, or (at your option)
  2325. X#    any later version.
  2326. X# 
  2327. X#    This program is distributed in the hope that it will be useful,
  2328. X#    but WITHOUT ANY WARRANTY; without even the implied warranty of
  2329. X#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  2330. X#    GNU General Public License for more details.
  2331. X# 
  2332. X#       By Larry Broda
  2333. X#       Department of Psychology
  2334. X#       University of Illinois at Urbana-Champaign
  2335. X#       Email: lbroda@s.psych.uiuc.edu
  2336. X#       4/8/92
  2337. X# 
  2338. X#    GNU emacs information:
  2339. X#    contact:
  2340. X#    Free Software Foundation
  2341. X#    675 Massachusetts Avenu
  2342. X#    Cambridge, MA 02139
  2343. X#    USA
  2344. X#
  2345. X#
  2346. X# setup environmental variables used by easy-edit
  2347. X#
  2348. Xexport EASY_EL; EASY_EL=$EE_LIB/easyedit.el
  2349. Xexport EASYEDIT_HELP; EASYEDIT_HELP=$EE_LIB/HELP-WINDOW
  2350. Xexport EASYEDIT_MANUAL ; EASYEDIT_MANUAL=$EE_LIB/HELP-MANUAL
  2351. Xexport HELP_LEVEL ; HELP_LEVEL=basic
  2352. Xexport EE_HELP_OFF ; unset EE_HELP_OFF 
  2353. XME=$0
  2354. XFILE=nofile$$
  2355. X
  2356. X#
  2357. X# process command line args
  2358. X#
  2359. Xfor ARG
  2360. Xdo
  2361. X    case $ARG in
  2362. X        -e) export HELP_LEVEL; HELP_LEVEL=advanced ;;
  2363. X        -[Zz]) export EE_HELP_OFF; EE_HELP_OFF=y ;;
  2364. X        -*) /bin/echo "Unrecognized option: $ARG" ;
  2365. X            /bin/echo "Form: $ME [-e][-z] filename" ;
  2366. X            /bin/echo "Options: -e - start with advanced HELP window"
  2367. X            /bin/echo "         -z - start with no HELP window"
  2368. X            exit 1 ;;
  2369. X        *) if [ "$FILE" != "nofile$$" ]; then
  2370. X                 /bin/echo "Form: $ME [-e] filename" 
  2371. X                 exit 1 
  2372. X            else
  2373. X                FILE="$ARG"
  2374. X            fi ;;
  2375. X    esac
  2376. Xdone
  2377. X
  2378. X#
  2379. X# check the file to edit, prompt for it if not on command line
  2380. X#
  2381. Xif [ "$FILE" = "nofile$$" ]; then
  2382. X    /bin/echo -n "File: "
  2383. X    read FILE
  2384. Xfi
  2385. Xif [ "$FILE" = "" ]; then
  2386. X    /bin/echo "You must call $0 with a filename or give a filename when asked"
  2387. X    /bin/echo " e.g.  $0 filename"
  2388. X    exit 1
  2389. Xfi
  2390. Xif [ -d "$FILE" ]; then
  2391. X    /bin/echo "$FILE is a directory.  You cannot edit a directory."
  2392. X    exit 1
  2393. Xfi
  2394. X
  2395. X$GNUemacs -no-init-file "$FILE" -l $EE_LIB/$EASY_EL 
  2396. END_OF_FILE
  2397. if test 2241 -ne `wc -c <'ee.sh.template'`; then
  2398.     echo shar: \"'ee.sh.template'\" unpacked with wrong size!
  2399. fi
  2400. # end of 'ee.sh.template'
  2401. fi
  2402. echo shar: End of archive 1 \(of 1\).
  2403. cp /dev/null ark1isdone
  2404. MISSING=""
  2405. for I in 1 ; do
  2406.     if test ! -f ark${I}isdone ; then
  2407.     MISSING="${MISSING} ${I}"
  2408.     fi
  2409. done
  2410. if test "${MISSING}" = "" ; then
  2411.     echo You have the archive.
  2412.     rm -f ark[1-9]isdone
  2413. else
  2414.     echo You still need to unpack the following archives:
  2415.     echo "        " ${MISSING}
  2416. fi
  2417. ##  End of shell archive.
  2418. exit 0
  2419.